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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
m_anees
Regular Visitor

Retrieve the value from a column based on the max of f grouping if other column

I need to visulize a card with the max of the total profit for each project No,but I need to visulize the project number not the max profit vlaue itself 

this is a sample of the data 

 

ProjectNoCategoryProfit
1Lic1000
1Dev1000
2Lic2000
2Lic1000
2Dev1000

 

This how I want to display the card 

"The Max project Number profit is"2

Appricaite your help

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @m_anees 

Place this measure in a card visual

Measure =
VAR aux_ =
    TOPN ( 1, ALL ( Table1[ProjectNo] ), CALCULATE ( SUM ( Table[Profit] ) ) )
RETURN
    "The Max project Number profit is " & MAXX ( aux_, [ProjectNo] )

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

View solution in original post

4 REPLIES 4
AlB
Community Champion
Community Champion

Hi @m_anees 

Place this measure in a card visual

Measure =
VAR aux_ =
    TOPN ( 1, ALL ( Table1[ProjectNo] ), CALCULATE ( SUM ( Table[Profit] ) ) )
RETURN
    "The Max project Number profit is " & MAXX ( aux_, [ProjectNo] )

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

m_anees
Regular Visitor

Thank you so much 

amitchandak
Super User
Super User

@m_anees , Try a measure like

 

measure = "The Max project Number profit is" & CALCULATE(Max(Table[Project]),TOPN(1,all(Table[ProjectNo]),calculate(Sum(Table[Profit])),DESC),VALUES(ProjectNo[ProjectNo]))

 

TOPN should help : https://www.youtube.com/watch?v=QIVEFp-QiOk

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you so much it's working 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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