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

Highest Count Group

Hi all,

    I am in need of calculating and displaying the Highest Count Group in a Card Visual.

 

Note: Sample PBIX is given below,

 

Sample PBIX

 

1. What I have done so far -

 

 I created a DAX to calculate the Maximum of Reason for a given Slicer selection.

 

ID Selection.PNG

3.PNG

 

I used a formula for achieving the above result,

 

MyMeasure = CONCATENATE("Won Reason ", "(" & MAXX(VALUES('Table'[Reason]),CALCULATE(COUNT('Table'[Reason]))) & " / " & COUNTROWS('Table') & ")" )

 

2. What I need further?

Now, I wanted to count and display the highest count group by Won Reason. Please refer the below screenshot to get more idea, How can I achieve this? Please help on this.

 

2.png

 

In that 4 --> 3 are due to Quality and 1 is due to price. Likewise, how can I get the results.

 

 

Many Thanks,

Praveen

2 ACCEPTED SOLUTIONS
Zubair_Muhammad
Community Champion
Community Champion

Hi @Anonymous 

 

Try this measure in a card visual

 

Measure =
CONCATENATEX (
    TOPN (
        1,
        SUMMARIZE (
            'Table',
            [Reason],
            'Table'[Detailed],
            "Won Reason", COUNT ( 'Table'[Reason] )
        ),
        CALCULATE (
            MAXX ( VALUES ( 'Table'[Reason] ), CALCULATE ( COUNT ( 'Table'[Reason] ) ) ),
            ALLEXCEPT ( 'Table', 'Table'[Reason] )
        ), DESC
    ),
    [Won Reason] & " - " & [Detailed],
    UNICHAR ( 10 ),
    [Won Reason], DESC
)

Regards
Zubair

Please try my custom visuals

View solution in original post

@Anonymous 

 

It works with sample data 🙂 as a card visual

 

Praveen.png


Regards
Zubair

Please try my custom visuals

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

Hi @Anonymous 

 

Try this measure in a card visual

 

Measure =
CONCATENATEX (
    TOPN (
        1,
        SUMMARIZE (
            'Table',
            [Reason],
            'Table'[Detailed],
            "Won Reason", COUNT ( 'Table'[Reason] )
        ),
        CALCULATE (
            MAXX ( VALUES ( 'Table'[Reason] ), CALCULATE ( COUNT ( 'Table'[Reason] ) ) ),
            ALLEXCEPT ( 'Table', 'Table'[Reason] )
        ), DESC
    ),
    [Won Reason] & " - " & [Detailed],
    UNICHAR ( 10 ),
    [Won Reason], DESC
)

Regards
Zubair

Please try my custom visuals

@Anonymous 

 

It works with sample data 🙂 as a card visual

 

Praveen.png


Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

Awesome Thank you very much for your prompt solution.

 

Hearty Thanks again,

Praveen.

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.