Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Show orders with multiple product categories

Hello!

 

I have dataset with orders. Some orders have products from only one category, other orders have products from multiple categories. I'd like to show how many orders have products from multiple categories and how many orders have products from only one category. Additionaly I'd like to have possibility to see orders that contains selected category.

 

I tried with DISTINCTCOUNT and it showed orders with multiple categories but I couldn't filter by selected category. Is there any solution?

 

Example data table is below:

 

orderproductdivision
b112a
b121b
b122b
b212a
b221b
b222b
b232c
b332c
b332c
b412a
b432c
b532c
b621b
b622b

Thanks for any hints!

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Try the following measure:

Measure = CALCULATE(DISTINCTCOUNT('Table'[order]),FILTER(ALLSELECTED('Table'),'Table'[product]=MAX('Table'[product])))

It will return what you want!

vluwangmsft_0-1626937079229.png

vluwangmsft_1-1626937090087.png

 

 

Wish it is helpful for you!

 

Best Regards

Lucien

View solution in original post

3 REPLIES 3
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Try the following measure:

Measure = CALCULATE(DISTINCTCOUNT('Table'[order]),FILTER(ALLSELECTED('Table'),'Table'[product]=MAX('Table'[product])))

It will return what you want!

vluwangmsft_0-1626937079229.png

vluwangmsft_1-1626937090087.png

 

 

Wish it is helpful for you!

 

Best Regards

Lucien

amitchandak
Super User
Super User

@Anonymous , Plot this measure with product

countx(filter(summarize(Table, Table[product], "_1", distinctCOUNT(Table[division])), [_1]>1), [product])

 

Change the column in measure as per need

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks @amitchandak , unfortunately this measure gives no result, even on my sample data 😞

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors