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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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