How do I calculate the percentage contribution of each category while considering multiple slicers

0 votes

How do I calculate the percentage contribution of each category while considering multiple slicers?
I need a Power BI measure that calculates the percentage contribution of each category (e.g., product, region) to the total, ensuring that the percentage dynamically updates based on user-applied slicers. How can I use DAX functions like CALCULATE(), ALL(), or ALLSELECTED() to ensure that the measure properly accounts for different filtering scenarios?

12 hours ago in Power BI by Evanjalin
• 22,610 points
15 views

1 answer to this question.

0 votes

You can calculate the percentage contribution dynamically using CALCULATE(), ALL(), or ALLSELECTED() to control filter context.

1. Create the Percentage Contribution Measure

% Contribution =
VAR TotalSales = CALCULATE([Total Sales], ALLSELECTED('Sales'))
RETURN
DIVIDE([Total Sales], TotalSales, 0)

2. Explanation

ALL SELECTED ('Sales') checks that total consider active slicer filters while filtering out row-level filters (filtering by column, for example).

DIVIDE() avoids the division by zero problems.

3. How It Works

In this case, if the user applies a filter by Region, the percentage will be evaluated for only those selected regions.

When no filter is applied, it shows the overall contribution of each category in sales.

answered 12 hours ago by anonymous
• 22,610 points

Related Questions In Power BI

0 votes
1 answer

In DAX, how do I RETURN the sum of a calculated column from a DAX Table Variable (created via ADDCOLUMN)?

You can access column variables of previously ...READ MORE

answered Oct 8, 2020 in Power BI by Gitika
• 65,770 points
4,745 views
0 votes
2 answers

How can I set up cascading slicers in Power BI, where one slicer’s options depend on the selection of another?

Use the dependent slicers by making a ...READ MORE

answered Jan 23 in Power BI by anonymous
• 21,730 points
157 views
0 votes
1 answer

How can I calculate the year-over-year percentage change using custom fiscal week numbers in Power BI Desktop?

In Power BI, to evaluate the YoY ...READ MORE

answered Feb 28 in Power BI by anonymous
• 22,610 points
52 views
0 votes
1 answer

How can I reduce the memory usage of a complex DAX calculation that involves multiple SUMX() iterations?

To reduce memory usage in a complex ...READ MORE

answered Mar 10 in Power BI by anonymous
• 22,610 points
41 views
+2 votes
0 answers

Assume referential integrity

1) What is Assume referential integrity? what ...READ MORE

Aug 19, 2019 in Power BI by vnk
1,949 views
+2 votes
1 answer

If Condition

DAX - I assume [Claim_line].[Allowed_Amount_B6] is one ...READ MORE

answered Aug 20, 2019 in Power BI by anonymous
• 33,050 points
1,754 views
+2 votes
1 answer

How to export data to CSV from power bi embedded url ?

Hi Arathi, You can open Visuals from embedded ...READ MORE

answered Aug 23, 2019 in Power BI by anonymous
• 33,050 points
6,799 views
+1 vote
1 answer

Power Bi to Machine Learning Model

Hello @vnk! Power BI only supports Azure Machine ...READ MORE

answered Dec 3, 2019 in Power BI by Priyanka
1,333 views
0 votes
1 answer

I need to calculate a running total but reset it at the start of each new quarter—how can I achieve this in DAX?

To calculate a running total that resets ...READ MORE

answered Mar 7 in Power BI by anonymous
• 22,610 points
67 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP