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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Jhoyt10
New Member

Power BI: Attribute filtered 2x's and I want to measure the output

Hello, I am trying to obtain the difference between payments on an attribute that has 2 filters, preferably all in 1 row with the difference in a column.

EG: For Hospital A, I want to look at the difference in payments/procedure by procedure code filtered on Attribute "CPT_Code" = (99285 and 99291). 

It creates 2 rows and I cant figure out how to get the difference between the 2 outputs. Any assistance is greatly appreciated!  

Jhoyt10_0-1746018159169.png

 

1 ACCEPTED SOLUTION
ray_aramburo
Super User
Super User

You can write the following measure:

Code Difference = CALCULATE([YourProcedureCountOrSumMeasure], 'TableName'[CPT_Code] = "99285") - CALCULATE([YourProcedureCountOrSumMeasure], 'TableName'[CPT_Code] = "99291")

Note that if the Code column is numerical you'll need to remove the "" from the formula 🙂 

 

If I misunderstood and if it's the totals of those 2 codes then just add the CALCULATES instead of subtracting them 





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





View solution in original post

1 REPLY 1
ray_aramburo
Super User
Super User

You can write the following measure:

Code Difference = CALCULATE([YourProcedureCountOrSumMeasure], 'TableName'[CPT_Code] = "99285") - CALCULATE([YourProcedureCountOrSumMeasure], 'TableName'[CPT_Code] = "99291")

Note that if the Code column is numerical you'll need to remove the "" from the formula 🙂 

 

If I misunderstood and if it's the totals of those 2 codes then just add the CALCULATES instead of subtracting them 





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.