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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Display Highest Value of Count in a Card

I'm trying to display the highest 'id' value in a table with the most appearances (highest number of Count). The attached screenshot shows what I mean. Since the 'customer_id' value of 3220 appears 90 times, I want the card to display 3220 as the value. How do I do this?

 

 Screenshot 2020-07-09 at 09.29.15.png

1 ACCEPTED SOLUTION

hi  @Anonymous 

Ok, for your case, there are some blank [customer_id] in the table, so adjust the formula as below:

Highest Value of Count = 
var _countid=MAXX(FILTER(ALLSELECTED('Sheet1'[customer_id]),[customer_id]<>BLANK()),CALCULATE(COUNTA('Sheet1'[customer_id]))) return
CALCULATE(MAX('Sheet1'[customer_id]),FILTER(VALUES('Sheet1'[customer_id]),CALCULATE(COUNTA('Sheet1'[id]))=_countid))

Result:

12.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

14 REPLIES 14
v-lili6-msft
Community Support
Community Support

hi @Anonymous 

For your case, just create a measure as below:

Highest Value of Count = 
var _countid=MAXX(ALLSELECTED('Table'[customer_id]),CALCULATE(COUNTA('Table'[customer_id]))) return
CALCULATE(MAX('Table'[customer_id]),FILTER('Table',CALCULATE(COUNTA('Table'[customer_id]))=_countid))

 

then drag it into a card visual.

7.JPG

here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Screenshot 2020-07-10 at 11.13.00.png

hi  @Anonymous 

You could copy the formula of measure and just change the table name for yours

Highest Value of Count =
VAR _countid =
    MAXX (
        ALLSELECTED ( 'Table'[customer_id] ),
        CALCULATE ( COUNTA ( 'Table'[customer_id] ) )
    )
RETURN
    CALCULATE (
        MAX ( 'Table'[customer_id] ),
        FILTER ( 'Table', CALCULATE ( COUNTA ( 'Table'[customer_id] ) ) = _countid )
    )

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I did as you instructed but ended up with a (Blank) as a result...

 

Screenshot 2020-07-10 at 12.18.39.png

hi  @Anonymous 

Could you please share your sample pbix file for us have a test, that will be a great help.

You can upload it to OneDrive for business and post the link here. Do mask sensitive data before uploading.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

https://techship1-my.sharepoint.com/:u:/g/personal/eric_shao_techship_com/EX3OubkDqtpNrJXzlelYWP4BU1... 

Here is the link. I only kept the table with the two columns needed.

hi  @Anonymous 

Ok, for your case, there are some blank [customer_id] in the table, so adjust the formula as below:

Highest Value of Count = 
var _countid=MAXX(FILTER(ALLSELECTED('Sheet1'[customer_id]),[customer_id]<>BLANK()),CALCULATE(COUNTA('Sheet1'[customer_id]))) return
CALCULATE(MAX('Sheet1'[customer_id]),FILTER(VALUES('Sheet1'[customer_id]),CALCULATE(COUNTA('Sheet1'[id]))=_countid))

Result:

12.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous,

you didn't tell us that your column customer_id contains blank ids. That's messy.

But here is my solution:

 

13-07-_2020_23-46-50.png

 

 

Regards FrankAT

Hi @Anonymous,

take a look at the following measure:

 

10-07-_2020_12-46-40.png

 

Anonymous
Not applicable

The column [Count of id] does not exist in my data. That column is calculated by doing a Count on the appearances of column [id].

Hi @Anonymous,

here is my revised solution:

[1] Only for overview

[2] Card visual with returned value of my sample data

 

10-07-_2020_14-17-55.png

 

Regards FrankAT

Anonymous
Not applicable

Screenshot 2020-07-13 at 14.18.43.png

Still getting (Blank) as a RETURN value. VAR _HighestCount comes out to be 90 as expected.

amitchandak
Super User
Super User
Anonymous
Not applicable

I'm unable to use or interact with any visual level filters that are put on the Card?

https://community.powerbi.com/t5/Desktop/Problem-with-visual-level-filtering-on-card/td-p/31635/page...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.