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
Farrah24
Frequent Visitor

Display status based on their value

Hi!

So i have data of App Sales for each platform, (A platform, B platform and C platform). I want to show the status of if the app is "Profitable"  or "Unprofitable" based on their summation between sales in A and C platform. The status of the app will give an output "Profitable" like in A-22 App, Category B50B in August 2000, and "Unprofitable" for A-22 App, B51 Category in Oct 2000.

I'm planning to show the status with Card Visualization with the date slicer.

Farrah24_0-1669266790705.png


Here is the data i used. I'm really new to DAX so i would really appreciate if anyone also can show the code in DAX. Thankyou in Advance!
Sales Data 

1 ACCEPTED SOLUTION

@Farrah24 try this one

 

Status = var _D = CALCULATE(max('Table'[Date]),ALLSELECTED('Table'[Date]))
         return
         if(CALCULATE(sum('Table'[Platform A Sales, USD]) + sum('Table'[Platform C Sales, USD]),'Table'[Date] = _D) = 0 ,"Unprofitable " & _D,"Profitable " & _D)

View solution in original post

3 REPLIES 3
ddpl
Solution Sage
Solution Sage

@Farrah24 Hi try by creating below measure for card visual.

 

measure = var _A = sum('Tablename'[Platform A Sales, USD])
        var _B = SUM('Tablename'[Platform C Sales, USD])
        var _S = _A + _B
  return
       if(_S = 0 ,"Unprofitable","Profitable")
Farrah24
Frequent Visitor

Hi! Thanks for your reply!

I want to show the status dynamically with the last selected date in the slicer. I've tried to make slicer date in form of dropdown or list where it only have one value selected, and it work perfectly. But not when i have range of date, although i already make another measure to pick up last date selected its still not working. Here's the preview of my desktop, i also upload my pbix on last link. Thankyou in advance!

Farrah24_0-1669278847929.png

 

@Farrah24 try this one

 

Status = var _D = CALCULATE(max('Table'[Date]),ALLSELECTED('Table'[Date]))
         return
         if(CALCULATE(sum('Table'[Platform A Sales, USD]) + sum('Table'[Platform C Sales, USD]),'Table'[Date] = _D) = 0 ,"Unprofitable " & _D,"Profitable " & _D)

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.