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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Fixed Max of Distinct Count in a table

I have a data like this

1.JPG

I have created a measure count# = distinctcount(#Req)

2.JPG

Now how can i achieve max count # ?

 

I have tried

calculated(maxx(table,count#),allexcept(table,Item))

 

i just couldt get the result.

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @Anonymous 

Assuming the second image you show is a table/matrix visual, you can create a measure like this:

 

max count # =
MAXX ( ADDCOLUMNS ( ALL ( Table1[Item] ), "_Res", [count#] ), [_Res] )

 

where [count#] is the measure you already have:

 

count# = DISTINCTCOUNT(Table1[#Req])

and Table1 is the first table you show.

 

On a different note, please always show your sample data in text-tabular format in addition to (or instead of) the screen captures. That allows people trying to help to readily copy the data and run a quick test, plus it increases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here.

View solution in original post

2 REPLIES 2
AlB
Community Champion
Community Champion

Hi @Anonymous 

Assuming the second image you show is a table/matrix visual, you can create a measure like this:

 

max count # =
MAXX ( ADDCOLUMNS ( ALL ( Table1[Item] ), "_Res", [count#] ), [_Res] )

 

where [count#] is the measure you already have:

 

count# = DISTINCTCOUNT(Table1[#Req])

and Table1 is the first table you show.

 

On a different note, please always show your sample data in text-tabular format in addition to (or instead of) the screen captures. That allows people trying to help to readily copy the data and run a quick test, plus it increases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here.

Anonymous
Not applicable

Hi Thanks, it works perfectly!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.