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
anwilkins
Resolver II
Resolver II

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 II
Resolver II

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
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.