Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello,
I have got a below data:
Country | Company | Category |
X | AB | A |
Z | AC | A |
Y | AD | B |
Y | AB | C |
X | AD | B |
Z | AB | A |
X | AC | B |
X | AB | C |
Y | AC | A |
Z | AB | A |
I was using below measure CategoryPercentage =
DIVIDE(
COUNT('YourTable'[Category]),
CALCULATE(COUNT('YourTable'[Category]), ALL('YourTable')),
0
)
to get the % but the when I use slicer of country or company the numerator gets slicer but due to ALL function demominator count of category remains same which makes category in that country divided by again total count of column rather then sliced by country slicer. I want if I do not select slicer then each category divide by total column count. But if I select slicer of country then each category available in that country divde by the category column count which was in that country.
Basically I was looking to see only top 5 Categories % as all or once they are sliced by slicer of country and company.
Your hel would be highly appreciated.
Thank you
Solved! Go to Solution.
Hi @PowerBI__ Try this:
CategoryPercentage =
DIVIDE(
COUNT('YourTable'[Category]),
CALCULATE(
COUNT('YourTable'[Category]),
REMOVEFILTERS('YourTable'[Category])
),
0
)
To show only the top 5 categories by percentage, you can use a visual-level filter:
Hope this helps!!
If this solved your problem, please accept it as a solution and a kudos!!
Best Regards,
Shahariar Hafiz
Hi @PowerBI__ Try this:
CategoryPercentage =
DIVIDE(
COUNT('YourTable'[Category]),
CALCULATE(
COUNT('YourTable'[Category]),
REMOVEFILTERS('YourTable'[Category])
),
0
)
To show only the top 5 categories by percentage, you can use a visual-level filter:
Hope this helps!!
If this solved your problem, please accept it as a solution and a kudos!!
Best Regards,
Shahariar Hafiz
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
75 | |
68 | |
41 | |
35 |
User | Count |
---|---|
107 | |
56 | |
52 | |
48 | |
40 |