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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
brettgrubbs
Frequent Visitor

Sum of counts for each category with % total

I have tried many different suggestions from this forum allselected, allexcept, summarize as a new table and everything I just cannot figure this out. I need a total count for each provider to calculate the percent of each subcategory. I have the following table and if I can get it to work then I can put it on the visual to compare the % totals rather than counts. I have a page that can be filtered by year, month, and provider(s) . I need the total and % for each provider based on the selections in the filters. 

Here are the two measures as I have it now since this was the closest I have gotten. 

Here is a link to a greatly reduced excel file that shows on the first tab what I want to see and the 600 rows with what I think are the minimum columns need for this visual. The date column is linked to a date table and the provider ID is linked to a provider table but I just included the provider as a column to make it easier. The slicers on the below page are of course using the date and provider tables to filter.    

 

Total CPT Count by Provider = CALCULATE(Count(CPTsByEncounterAndClaim[Encounter ID]),ALLSELECTED(CPTsByEncounterAndClaim[Encounter ID]))

% Total CPT by Provider = DIVIDE(Count(CPTsByEncounterAndClaim[Encounter ID]),CPTsByEncounterAndClaim[Total CPT Count by Provider],0)

 

corrections shown in orange and redcorrections shown in orange and red

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@brettgrubbs , Change the total like

 

Total CPT Count by Provider = CALCULATE(Count(CPTsByEncounterAndClaim[Encounter ID]),Filter(ALLSELECTED(CPTsByEncounterAndClaim),CPTsByEncounterAndClaim[Provider] = max(,CPTsByEncounterAndClaim[Provider])))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@brettgrubbs , Change the total like

 

Total CPT Count by Provider = CALCULATE(Count(CPTsByEncounterAndClaim[Encounter ID]),Filter(ALLSELECTED(CPTsByEncounterAndClaim),CPTsByEncounterAndClaim[Provider] = max(,CPTsByEncounterAndClaim[Provider])))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thanks, It works great but I don't quite follow the logic... basically you changed it to filter the "ALLSELECTED" CPTsByEncounterAndClaim table which should be 600 rows by the provider... but I don't understand how "MAX" works in this filter when I have more than one provider selected... wouldn't it just return "RRO"? 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.