Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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"
Solved! Go to Solution.
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] ) )
)
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.
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] ) )
)
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.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!