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
I have data similar to this:
Sale Id | Item Id | Color
===============
1 | Toy Car | Blue
2 | Stuffed Animal | Green
3 | Toy Car | Red
4 | Toy Car | Blue
5 | Stuffed Animal | Purple
I want to summarize the most common color for each item. In effect I'm looking for the "mode" of a set of string values. So the output would be:
Item Id | Most Common Color | MCC Count
============================
Toy Car | Blue | 2
Stuffed Animal | Purple | 1
(Note that there is a tie for Green or Purple for Stuffed Animal. I'm not picky. I want one of the colors that is tied for top.)
Perf. is a bit of a concern so I'm hoping to find a way to do this in a single summarize operation.
I can live without the most common color count column, if that's harder to generate.
Thanks in advance!
@rhaining Try:
MCC Count Measure =
VAR __Table = SUMMARIZE('Table', [Color]), "__Count", COUNTROWS('Table'))
VAR __Result = MAXX(__Table, [__Count])
RETURN
__Result
Most Common Color Measure =
VAR __Table = SUMMARIZE('Table', [Color]), "__Count", COUNTROWS('Table'))
VAR __Max = MAXX(__Table, [__Count])
VAR __Result = MAXX(FILTER(__Table, [__Count] = __Max), [Color])
RETURN
__Result
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!