cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AWF14978
Frequent Visitor

Dax Total incorrectly 0 (Currently using If with Text)

Good Morning, 

 

I currently have the below formula that brings through the correct figure when filtered by location (see below), however the total is 0 despite values being present, This is likely because I have embedded values with text. how do I sum the values and ignore the text (but also keep the text within the Matrix)?

 

 

Lost_Margin = 
var iFF=
IF('PED Tracker'[PED_Sales]/ [Gross_Sales] = 0 && 
                    [Gross_Sales]>0,[Gross_Sales]*[Avg_ped_pen]/1.2*0.72,
                    IF('PED Tracker'[PED_Sales]/ [Gross_Sales] = 0 && [Gross_Sales]<=0,"Dark",0))

                    Return iFF

 

 

AWF14978_0-1673950084263.png

Thank you for your help! 

 

Kind regards,

AF

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@AWF14978 , You have change return like

 

Sumx(Values(Date[Month]), calculate(iFF) )

 

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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@AWF14978 , You have change return like

 

Sumx(Values(Date[Month]), calculate(iFF) )

 

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

Helpful resources

Announcements
Vote for T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors