Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello Guys,
Please help on the correct DAX formula.
For example, I have this source. I just need to get the percentage of colors based on the total count.
I have seen some of the formula here but that is for numeric.
Type
Red
Red
Red
Blue
Green
Red
Blue
Green
Green
Red
Total is 10
Type Count Pct
Red 5 50%
Blue 2 20%
Green 3 30%
Hope you can help.
Thanks,
Hi @ishzoulify,
I've replicated your data into a table named Colours, which is how the following examples will be written for. You can do thi sin less steps, but this is how I would approach it, as I can re-use the measures later if I need to.
Create the following measures:
# Colours = COUNTROWS(Colours)# Total Colours = CALCULATE(
[# Colours],
ALL(Colours[Type])
)The ALL removes the filter on Type, which means that for each row it will count everything.
% of Total = DIVIDE(
[# Colours],
[# Total Colours]
)This measure then gets formatted as a percentage.
Here's my results, with all measures shown for completeness:
Here's a copy of my workbook for your reference, in case you want to check anything.
Regards,
Daniel
If my post solves your challenge, then please consider accepting as a solution to help other forum members find the answer more quickly 🙂
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |