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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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