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
jonnyA
Responsive Resident
Responsive Resident

Need help with a Power BI formula with specifis Procedure Codes

I need help creating a formula to only bring back Procedure Codes that are only 99221, 99222, and 99223 (Readmission Procedure Codes).

 

Then I would need a formula that subtracts Total Procedure codes minus the formula above.

 

End Goal: Take Readmission Procedure Codes (First formula) minus Totasl Procedure Codes.

 

Thank you for your help in advance!

 

 

 

My dataset is Test_Discharge_Dataset

 

And Im using Field "Procedure Code"

 

 

1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

Hi @jonnyA ,

Please have a try.

Create measures.

 

Measure = IF(MAX('Table'[Procedure_Code])=99221,MAX('Table'[Procedure_Code]),IF(MAX('Table'[Procedure_Code])=99222,MAX('Table'[Procedure_Code]),IF(MAX('Table'[Procedure_Code])=99223,MAX('Table'[Procedure_Code]),BLANK())))
Measure2 =
VAR _sum =
    SUMX ( ALL ( 'Table' ), 'Table'[Procedure_Code] )
RETURN
    CALCULATE (
        [Measure] - _sum,
        FILTER ( ALL ( 'Table' ), 'Table'[DOS] <= SELECTEDVALUE ( 'Table'[DOS] ) )
    )

 

vpollymsft_0-1645435724105.png

vpollymsft_1-1645435747745.png

 

I have also found similar posts, please refer to it to see if then help you.

Create a Readmission Formula that only brings back accts where there was a readmission w/ in 90 days 

In Power BI can I create a formula for Date of Service that brings back specific Procedure Codes? 

 

If I have misunderstood your meaning, please provide your pbix without privacy information and desired output.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-rongtiep-msft
Community Support
Community Support

Hi @jonnyA ,

Please have a try.

Create measures.

 

Measure = IF(MAX('Table'[Procedure_Code])=99221,MAX('Table'[Procedure_Code]),IF(MAX('Table'[Procedure_Code])=99222,MAX('Table'[Procedure_Code]),IF(MAX('Table'[Procedure_Code])=99223,MAX('Table'[Procedure_Code]),BLANK())))
Measure2 =
VAR _sum =
    SUMX ( ALL ( 'Table' ), 'Table'[Procedure_Code] )
RETURN
    CALCULATE (
        [Measure] - _sum,
        FILTER ( ALL ( 'Table' ), 'Table'[DOS] <= SELECTEDVALUE ( 'Table'[DOS] ) )
    )

 

vpollymsft_0-1645435724105.png

vpollymsft_1-1645435747745.png

 

I have also found similar posts, please refer to it to see if then help you.

Create a Readmission Formula that only brings back accts where there was a readmission w/ in 90 days 

In Power BI can I create a formula for Date of Service that brings back specific Procedure Codes? 

 

If I have misunderstood your meaning, please provide your pbix without privacy information and desired output.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.