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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
schoden
Post Partisan
Post Partisan

Compare values of two measures

Hi All, 

 

I have two measures from two different table- both measures calculates sum of value with condition applied.

 

 

In the end I want to check if values from those two measures are equal or not. 

 

Final check = IF( Grand Margin== Margin , 1, 0)

 

final check.JPG

 

 

It doesnt really compare the values correctly.

 

Please help.

 

Cheers :D. 

7 REPLIES 7
amitchandak
Super User
Super User

@schoden , Try like

Final check = Sumx(values(Oppurtunity_recID), IF( [Grand Margin] = [Margin] , 1, 0))

 

Assumed [Grand Margin] , [Margin]  are measures

Hi @amitchandak 

 

It seems it it not iterating at row level.

 

final check.JPG

Hi @schoden,

AFAIK, measure formula results not changed by hosted tables. Did these measure formulas extract values from the same table field? If this is a case, I think you need to create an unconnected table and modify one of your formulas to use this new table field in source or these measure formulas will get the same result from the filter. (Dax format can't get different results from these same table field)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

@v-shex-msft  Hi , 

 

I have two tables connected with one-to- many relationships. Each table has one measure and I am trying to compare those two measure values. 

HI @schoden,

Can you please share pbix file with some dummy data to test?

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

@schoden , is opportunityrow_id is at the lowest level?

If not use that. Also are the avaiale as column at in table , you can try a colum like

 

Final check =  IF( [Grand Margin] = [Margin] , 1, 0)

Yes @amitchandak 

The first one was a new column , 

 

using SUMX - I changed to measure. 

 

both showed same.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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