'Power BI - How to calculate percent difference between two different values of one column within a matrix
Power BI newbie here, which is probably obvious. In the example of a matrix below, Term 1 and Term 2 are values from a variable called "Term" that I've placed in the Columns box. I'd like to add the "% Change" column as seen below, but I'm having trouble doing this. It seems like there would be an easy way to do this either with DAX or built-in options, but I'm unaware due to lack of experience. Any help would be much appreciated. Thanks!
ROW: Campus
COLUMN: Term
VALUES: Count
| Campus | Term 1 | Term 2 | Percent Diff |
|---|---|---|---|
| Camp A | 100 | 900 | __% |
| Camp B | 1400 | 2600 | __% |
Solution 1:[1]
The measure you are looking for is
Percent Diff =
DIVIDE (
SUM ( 'Table'[Term 2] ),
SUM ( 'Table'[Term 1] )
) - 1
The point is that measures only work with aggregations, SUM in this case.
Solution 2:[2]
Try this :
= SUM([Term 1])/((SUM([term 1])+SUM([Term 2]))/2)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Peter |
| Solution 2 | soniabhishek36 |
