cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chewie25 Frequent Visitor
Frequent Visitor

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

Accepted Solutions
Highlighted
Super User
Super User

Re: Fixed Max of Distinct Count in a table

Hi @chewie25 

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.

2 REPLIES 2
Highlighted
Super User
Super User

Re: Fixed Max of Distinct Count in a table

Hi @chewie25 

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.

chewie25 Frequent Visitor
Frequent Visitor

Re: Fixed Max of Distinct Count in a table

Hi Thanks, it works perfectly!

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 111 members 1,525 guests
Please welcome our newest community members: