Power BI - How to calculate percent difference between two different values of one column within a matrix

Viewed 1132

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 __%
2 Answers

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.

Try this :

= SUM([Term 1])/((SUM([term 1])+SUM([Term 2]))/2)
Related