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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

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

Share with Power BI Enthusiasts: 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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.