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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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