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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Max value by group

Hi there,

 

I have three table,

dorayeh161923_0-1647417111944.pngdorayeh161923_2-1647417164582.pngdorayeh161923_3-1647417203180.png

 

Group,Product,Sales

And I want to creat a new measure to show the max value for sales by groupname.

How to do this ? Please help me.

 

BRs

Dora.

 

 

 

 

 

1 ACCEPTED SOLUTION

Hi,

thank you for your explanation, and please check the below picture and the attached pbix file.

The new measure has to be written like below, and then you can select this measure as a "Field Value" inside the Conditional Formatting -> Background color option.

 

Picture1.png

 

Max sales value by groupname color format: = 
VAR maxsales =
    CALCULATE ( MAX ( Sales[Sales] ), ALLEXCEPT ( Sales, 'Group'[GroupName] ) )
RETURN
    IF ( SUM ( Sales[Sales] ) = maxsales, "Red" )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

6 REPLIES 6
Tahreem24
Super User
Super User

@Anonymous  Find the attached PBIX file for your reference. Refer the Relationship tab for joining between tables. then simply take sales and GroupName into simple table or visual.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

It is for creating a new measure.

 

Picture1.png

 

Max sales value by groupname: =
SUMX ( VALUES ( 'Group'[GroupName] ), CALCULATE ( MAX ( Sales[Sales] ) ) )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hi @Jihwan_Kim ,

Sorry I told not so clear,

My final purpose is to do like this.

The max turn background color in the same groupname.

How to do this? Thanks a lot.

dorayeh161923_1-1647423504355.png

 

 

BRs 

Dora.

 

Hi,

thank you for your explanation, and please check the below picture and the attached pbix file.

The new measure has to be written like below, and then you can select this measure as a "Field Value" inside the Conditional Formatting -> Background color option.

 

Picture1.png

 

Max sales value by groupname color format: = 
VAR maxsales =
    CALCULATE ( MAX ( Sales[Sales] ), ALLEXCEPT ( Sales, 'Group'[GroupName] ) )
RETURN
    IF ( SUM ( Sales[Sales] ) = maxsales, "Red" )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

@Jihwan_Kim  Thanks a lot

amitchandak
Super User
Super User

@Anonymous , Join sales with product table

 

then you can show

max(Sales[sales])

 

 

or

maxx(values(Product[Group Name]) , calculate(sum(sales[sales])))

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.