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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Rhodes
Frequent Visitor

Need Help calculating % Diff of multiple events and returning smallest difference in dax

Greetings.

 

I have a table in the following format:

image.png

 

I am attempting to create a table that looks like the one shown below but instead of the row subtotal it would show the % difference of the values in the rows above. 

 
 
 

image.png

I made a workaround for the individual metershed report by having the model and observed values in a table visual and the corresponding % difference values in separate card visuals. 

 

image.png

 

However, this workaround solution doesn't work well when trying to show a summary of the % difference for all the meters. Any suggestions on how to create a table with these know values and the calculated % difference values would be appreciated. Then from there, I would like to have a measure that returns the lowest % difference for a given metershed over the 3 calibration events.

 

Thanks,

Steven

Steven

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hi,

 

Please try this measure:

Measure = 
var a = CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),'Table'[Data Type]="Event AverageModel Flow"&&'Table'[Calibration Event] in FILTERS('Table'[Calibration Event])&&'Table'[Metershed] in FILTERS('Table'[Metershed])))
var b = CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),'Table'[Data Type]="Event AverageObserved Flow"&&'Table'[Calibration Event] in FILTERS('Table'[Calibration Event])&&'Table'[Metershed] in FILTERS('Table'[Metershed])))
return
IF(ISINSCOPE('Table'[Data Type]),FORMAT(SUM('Table'[Value]),"Fixed"),FORMAT((b-a)/a,"Percent"))

The result shows:

105.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

View solution in original post

2 REPLIES 2
v-gizhi-msft
Community Support
Community Support

Hi,

 

Please try this measure:

Measure = 
var a = CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),'Table'[Data Type]="Event AverageModel Flow"&&'Table'[Calibration Event] in FILTERS('Table'[Calibration Event])&&'Table'[Metershed] in FILTERS('Table'[Metershed])))
var b = CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),'Table'[Data Type]="Event AverageObserved Flow"&&'Table'[Calibration Event] in FILTERS('Table'[Calibration Event])&&'Table'[Metershed] in FILTERS('Table'[Metershed])))
return
IF(ISINSCOPE('Table'[Data Type]),FORMAT(SUM('Table'[Value]),"Fixed"),FORMAT((b-a)/a,"Percent"))

The result shows:

105.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

Thanks that worked!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.