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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.