cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
anwilkins
Resolver I
Resolver I

Lost Money / Earnings / Profits

Using medical Data - group therapy sessions have attendance status types. A status type is either billable or Not Billable to insurance. I created a new column named Bill Rate to identify which events yield funding , then created a measure to sum the total earnings. Now I need to determin how much funding was lost.

My status are :

AB = Attended - Billable
NS = No Show - Not Billable
LA = Client Was Late - Billable
LE = Client Left Early - Not Billable
XNB = Attended - Not Billable

 

The DAX for my new column is:

*Bill Rate =
IF(Rosters[Attendance Status] = "AB = Attended - Billable", "$131.56",
IF(Rosters[Attendance Status] = "LA = Client Was Late", "$131.56","$00.00"))
anwilkins_0-1637690045575.png

 

Next I wrote a measure to get my Total Earned 

anwilkins_1-1637690152218.png

I feel like there should be an easier way to say...

if [Attendance Status] contains "......Billable" then return 131.56 &

if  [Attendance Status] contains ".....Not - Billable" then return -131.56

 

The end goal is to determin how much revenue was lost by people who left early, did not show or attended but could not be billed for other reasons (XNB)

 

I'd like to avoid creating new columns if at all possible so be clear in your explanation if I need to create a measure or column as I am new. Thanks!

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@anwilkins 

is this what you want?

Column = 
VAR _check=SEARCH("not billable",'Table'[status],1,0)
return if('Table'[status]="",0,if(_check=0,-131,131))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

I knew there had to be  simpeler way then creating 2 columns and 2 measures! Thanks Ryan!

View solution in original post

4 REPLIES 4
anwilkins
Resolver I
Resolver I

In attempting to create 2 measures to show the potential profits and loss, I discovered another way to accomplish this without building a new column.

New Measures = 

Projected Revenue =
Calculate(SUM(Rosters[*BillRate]),FILTER(Rosters, Rosters[Attendance Status] IN {"AB = Attended - Billable","LA = Client Was Late - Billable"}))
Projected Loss =
Calculate(SUM(Rosters[*BillRate]),FILTER(Rosters, Rosters[Attendance Status] IN {"NS = No Show - Not Billable","XNB = Attended - Not Billable", "LE = Client Left Early - Not Billable"}))
 
anwilkins_0-1638295247151.png

 

 
ryan_mayu
Super User
Super User

@anwilkins 

is this what you want?

Column = 
VAR _check=SEARCH("not billable",'Table'[status],1,0)
return if('Table'[status]="",0,if(_check=0,-131,131))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I knew there had to be  simpeler way then creating 2 columns and 2 measures! Thanks Ryan!

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors