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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.