Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I'm trying to create a basic new measure (subtraction of values in one column from another but it's not working. I have two columns, Previous Month and Current Month. I need to create a new measure (Variance) which shows the increase or decrease in counts, see example below. The reason I need a new measure is in order to use field values in conditional formatting.
Previous Month Current Month Variance
100 250 150
100 50 -50
10 10 0
Solved! Go to Solution.
hi @Rnaval
can you tell us what exactly the error is?
below dax should be able to calculate the difference:
Variance = SUM('YourTable'[Current Month]) - SUM('YourTable'[Previous Month])
OR
Variance =
SUMX(
'YourTable',
'YourTable'[Current Month] - 'YourTable'[Previous Month]
)
Check the datatype if this does not work.
My Work:
Analytic Pulse Blog
Docynx Productivity Tools
Generate Realistic Sample Data Instantly online
hi @Rnaval
can you tell us what exactly the error is?
below dax should be able to calculate the difference:
Variance = SUM('YourTable'[Current Month]) - SUM('YourTable'[Previous Month])
OR
Variance =
SUMX(
'YourTable',
'YourTable'[Current Month] - 'YourTable'[Previous Month]
)
Check the datatype if this does not work.
My Work:
Analytic Pulse Blog
Docynx Productivity Tools
Generate Realistic Sample Data Instantly online
I used the following - Variance = SUM('YourTable'[Current Month]) - SUM('YourTable'[Previous Month]) and that works but under conditional formatting, the only option that works is the "=" option, I need the < and the > options which are not available.
Actually, I was able to get it working by using the if and clauses creatively and achived the desired results
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |