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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
aashton
Helper V
Helper V

Grouping by a field and finding the max

Hello,

So I have the following table structure:  

aashton_0-1655136567408.png

And use this DAX formula to find the total amount of Deals by Owner by Phase (one for each phase):

Phase 1 2022 Approvals Count by Owner =
CALCULATE(
DISTINCTCOUNT('Deal Review'[Deals Reviewed (Since 2019)]),
FILTER(
ALLEXCEPT('Deal Review','Deal Review'[Owner]),
SEARCH("2022", 'Deal Review'[Phase 1], , BLANK() ) > 0
))
 
I would now like to display on cards, the owners name that has the most Phase 1, Phase 2 and Phase 3's.  Not sure how to accomplish this?
 
Thank you.
1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @aashton 

Thanks for reaching out to us.

Let's take phase 1 as an example, create the measures
-

Phase 1 2022 Approvals Count by Owner =
CALCULATE (
    DISTINCTCOUNT ( 'Deal Review'[Deals Reviewed (Since 2019)] ),
    FILTER (
        ALL ( 'Deal Review' ),
        'Deal Review'[Owner] = MIN ( 'Deal Review'[Owner] )
            && SEARCH ( "2022", 'Deal Review'[Phase 1],, BLANK () ) <> BLANK ()
    )
)

-

max owner =
VAR _max =
    MAXX ( 'Deal Review', [Phase 1 2022 Approvals Count by Owner] )
RETURN
    CALCULATE (
        MAX ( 'Deal Review'[Owner] ),
        FILTER ( 'Deal Review', [Phase 1 2022 Approvals Count by Owner] = _max )
    )

result 

vxiaotang_0-1655347576428.png

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @aashton 

Thanks for reaching out to us.

Let's take phase 1 as an example, create the measures
-

Phase 1 2022 Approvals Count by Owner =
CALCULATE (
    DISTINCTCOUNT ( 'Deal Review'[Deals Reviewed (Since 2019)] ),
    FILTER (
        ALL ( 'Deal Review' ),
        'Deal Review'[Owner] = MIN ( 'Deal Review'[Owner] )
            && SEARCH ( "2022", 'Deal Review'[Phase 1],, BLANK () ) <> BLANK ()
    )
)

-

max owner =
VAR _max =
    MAXX ( 'Deal Review', [Phase 1 2022 Approvals Count by Owner] )
RETURN
    CALCULATE (
        MAX ( 'Deal Review'[Owner] ),
        FILTER ( 'Deal Review', [Phase 1 2022 Approvals Count by Owner] = _max )
    )

result 

vxiaotang_0-1655347576428.png

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Yes, that worked!!! Thank you so much

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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