Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Sorry for the rookie question but what's the easiest way to show/calculate the difference between two rows of data
e.g.
A 2020 10000
A 2021 15000
B 2020 30000
B 2021 40000
C 2020 50000
C 2021 60000
etc
Just simply showing in a Matrix by Letter and Year
2020 2021
A
B
C
...
Y
Z
Then I want to add an addtional set 'Y' which is just (B-C) for each year, and then in Z have some conditional logic based on whether Y is Positive/Negative.
Thanks in advance
Solved! Go to Solution.
Nothing of what you ask for is simple. It is relatively easy to create a measure.
Y := calculate(sum('Values'[Value]),'Values'[Category]="B")-
calculate(sum('Values'[Value]),'Values'[Category]="C")
But that would then go into the values well, and make your visual look off
To achieve the look you are going for you would actually have to create individual measures for A, B and C, and put them under rows. (and have nothing in the actual row headers)
A := calculate(sum('Values'[Value]),'Values'[Category]="A")
B := calculate(sum('Values'[Value]),'Values'[Category]="B")
C := calculate(sum('Values'[Value]),'Values'[Category]="C")
Y := [B]-[C]
Nothing of what you ask for is simple. It is relatively easy to create a measure.
Y := calculate(sum('Values'[Value]),'Values'[Category]="B")-
calculate(sum('Values'[Value]),'Values'[Category]="C")
But that would then go into the values well, and make your visual look off
To achieve the look you are going for you would actually have to create individual measures for A, B and C, and put them under rows. (and have nothing in the actual row headers)
A := calculate(sum('Values'[Value]),'Values'[Category]="A")
B := calculate(sum('Values'[Value]),'Values'[Category]="B")
C := calculate(sum('Values'[Value]),'Values'[Category]="C")
Y := [B]-[C]
thanks, that's really useful ...brings the usage of measures to life a bit for me.
much appreciated!!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!