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?

Mar 25 in Power BI by Evanjalin
• 25,690 points
69 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 Mar 25 by anonymous
• 25,690 points

Related Questions In Power BI

0 votes
1 answer

How do I dynamically calculate the first and last transaction date for each customer?

Calculation of the first transaction date and ...READ MORE

answered Apr 1 in Power BI by anonymous
• 25,690 points
63 views
0 votes
1 answer

How do I calculate the average time between two events for each customer?

To calculate the average time between two ...READ MORE

answered Apr 1 in Power BI by anonymous
• 25,690 points
58 views
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,772 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
• 22,890 points
190 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,969 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,776 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,836 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,360 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
• 25,690 points
92 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