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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
KylePerkins
Frequent Visitor

Calculating percent difference between results of two measures

 
I'm attempting to create a DAX measure which tells me the % difference of results from one measure to another. The measure I've written below gives me a result, however it is an incorrect % differnce which I confirmed when I calculate the % difference of the results by hand (see screen shots below for an example and the measure titled "Measure"). I also double checked my visual filters to be sure they were the same on both visuals shown below so I believe they should be displaying the same results. Any help on why this is happening would be greatly appreciated, thanks!
 
Savings Percent Difference (%) =
CALCULATE('Usage v2'[Measure],'Usage v2'[Improvement Package]='Usage v2'[run type],'Usage v2'[Method]="1")
/
CALCULATE('Usage v2'[Measure],'Usage v2'[Improvement Package]='Usage v2'[run type],'Usage v2'[Method]="2")

Measure =
SUMX(
FILTER('Usage v2','Usage v2'[run type] = "base"),
'Usage v2'[Value])
-
SUMX(
FILTER('Usage v2',
'Usage v2'[Improvement Package]='Usage v2'[run type]),
'Usage v2'[Value])


KylePerkins_1-1652711470397.png

The result in the graph above should be .275.

4 REPLIES 4
KylePerkins
Frequent Visitor

After trying that solution this is the result 

KylePerkins_0-1652715517337.png

Somehow now the result is shifted a decimal place... 

Here is the exact measure as is: 

% Savings = DIVIDE(
SUMX (
FILTER ( 'Usage v2' , 'Usage v2'[run type] = "base" ),
'Usage v2'[Value] )
-
SUMX (
FILTER ( 'Usage v2' ,
'Usage v2'[Improvement Package] = 'Usage v2'[run type] ),
'Usage v2'[Value] ),
SUMX (
FILTER ( 'Usage v2' ,
'Usage v2'[Improvement Package] = 'Usage v2'[run type] ),
'Usage v2'[Value] ))
 
Currently my Value column contains many different results  and I use filters specific to that visual to display results of a particular type. If I were to remove the filters the results displayed would be nonsensical. Is this structure perhaps why the results are incorrect? 
Whitewater100
Solution Sage
Solution Sage

Hi:

I think you can do this.

% Savings = DIVIDE(

SUMX(
FILTER('Usage v2','Usage v2'[run type] = "base"),
'Usage v2'[Value])
-
SUMX(
FILTER('Usage v2',
'Usage v2'[Improvement Package]='Usage v2'[run type]),
'Usage v2'[Value]), 
SUMX(
FILTER('Usage v2',
'Usage v2'[Improvement Package]='Usage v2'[run type]),
'Usage v2'[Value]))
 
Or in words You subtract your two measures and get result (A) 6.94 and (B) 5.44. Looks like you then subtract A-B or 6.94-5.44 to equal 1.5. Now  DIVIDE(1.5, B) or 1.5/5.44 = .275.
 
Again Measure A - Measure B = result
Final Measure = DIVIDE(result, Meaure B)
 
I hope this helps..

After trying that solution this is the result 

KylePerkins_0-1652715517337.png

Somehow now the result is shifted a decimal place... 

Here is the exact measure as is: 

% Savings = DIVIDE(
SUMX (
FILTER ( 'Usage v2' , 'Usage v2'[run type] = "base" ),
'Usage v2'[Value] )
-
SUMX (
FILTER ( 'Usage v2' ,
'Usage v2'[Improvement Package] = 'Usage v2'[run type] ),
'Usage v2'[Value] ),
SUMX (
FILTER ( 'Usage v2' ,
'Usage v2'[Improvement Package] = 'Usage v2'[run type] ),
'Usage v2'[Value] ))
 
Currently my Value column contains many different results  and I use filters specific to that visual to display results of a particular type. If I were to remove the filters the results displayed would be nonsensical. Is this structure perhaps why the results are incorrect? 

Hi:

I think if you can use the separate measures in the final divide or put extra ( ) to capture the subtraction part.

Measure A = 6.94

Measure B = 5.44

Measure C = Measure A - Measure B

% Measure = DIVIDE(Measure C, Measure B,0)

or

% Savings = DIVIDE((
SUMX (
FILTER ( 'Usage v2' , 'Usage v2'[run type] = "base" ),
'Usage v2'[Value] )
-
SUMX (
FILTER ( 'Usage v2' ,
'Usage v2'[Improvement Package] = 'Usage v2'[run type] ),
'Usage v2'[Value] )),
SUMX (
FILTER ( 'Usage v2' ,
'Usage v2'[Improvement Package] = 'Usage v2'[run type] ),
'Usage v2'[Value] ))
 
But using the first methode where you use measure names for your two results in the DIVIDE calculation is much easier to read and debug.
 
If you still experience an issue, can you share any example file so I can double check? Dummy data is ok. Thank you..

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.