Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Rnaval
Post Patron
Post Patron

Need help with a basic new measure

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

1 ACCEPTED SOLUTION
AnalyticPulse
Super User
Super User

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  










View solution in original post

3 REPLIES 3
AnalyticPulse
Super User
Super User

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.

 

Rnaval_0-1762029277572.png

 

Actually, I was able to get it working by using the if and clauses creatively and achived the desired results

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.