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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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