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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
SophRow
Resolver II
Resolver II

% of grand total by field parameter

Hi Experts,

 

Can you help me with a measure so I can show the percentage by Service on the following bar chart:

 

SophRow_0-1685940265818.png

 

So for Total Services, the % would be (by Illness Burden Category per example above):

 

  • 1-5: 3.8%
  • 6-10: 8.7%
  • 11-15: 19.7%
  • 16-20: 67.8%

The data looks like this:

 

SophRow_1-1685940422146.png

 

And the Illness burden category is a field parameter:

 

SophRow_2-1685940464947.png

 

When I switch to Age range and Gender, I also want the chart to show % of total by Service. 

 

Thanks in advance 🙂

Soph

 

3 REPLIES 3
data_freak
Regular Visitor

Hey @SophRow 

Apologies for the confusion. The use of SUM('Table'[Count]) and [Total Count] in my previous response was incorrect. There is no difference between them, and it was an oversight on my part.

To clarify, you only need to create the "Total Count" measure using the formula. Hope this helps!

data_freak
Regular Visitor

Hi @SophRow 

 

I think the following steps should help in solving this problem:

 

  • Start by creating a bar chart with the Service as the axis and the count of records as the value.
  • Create a new measure to calculate the total count of records. You can use the following DAX formula:

Total Count = SUM('YourTable'[YourCount field])

 

  • Create another measure to calculate the percentage by service. You can use the following DAX formula:

Percentage by Service = DIVIDE(SUM('Table'[Count]), [Total Count])

 

  • Add the newly created "Percentage by Service" measure to the Values section of the visual. Make sure it is set to display as a percentage. Next, to switch to Age range and Gender, create a slicer or dropdown list for the Illness burden category field.
  • Add the Illness burden category field to the visual as a legend or axis, depending on your desired visual representation.
  • Now, when you select different values in the Illness burden category slicer or dropdown list, the bar chart will automatically update to show the percentage of the total by service based on the selected category.

 

Please cross check that you have the appropriate relationships established between the tables in your data model to ensure accurate calculations.

 

If this has solved your problem, please mark my post as solution.

Cheers

Thanks @data_freak - just a quick Q - for the % by service measure, what's the difference between SUM('Table'[Count]) and Total Count?

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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