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
Anonymous
Not applicable

IF condition but need to show total

Hello Everyone,
 
I have this condition that only if the result is negative then it would show else it would show blank. Problem is, it would no longer show the total. Would you know the reason why and do you have another way of writing this DAX to show the total?
 
Saving (USD) = IF(([Variance] * CALCULATE(SUM(Salary[Salary in USD]),TREATAS(DISTINCT(Table1[Delivery Country]),Salary[Country]))) >0,"",([Variance] * CALCULATE(SUM(Salary[Salary in USD]),TREATAS(DISTINCT(Table1[Delivery Country]),Salary[Country]))))
 
Thank you!
Here's a screenshot of the table
 
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Based on the group by in yourr visual, you need to create a measure

 

sumx(Values(Table1[Delivery Country]),[Saving (USD)])

 

and use that.

 

Also, check

https://www.youtube.com/watch?v=ufHOOLdi_jk

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Based on the group by in yourr visual, you need to create a measure

 

sumx(Values(Table1[Delivery Country]),[Saving (USD)])

 

and use that.

 

Also, check

https://www.youtube.com/watch?v=ufHOOLdi_jk

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.