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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Alan_
Advocate II
Advocate II

Dynamic Max

Hi, I need to find the max values based a column value, basicly the highest value for each site.

 

So for site 1 = 180, site 2 = 173 and site 3 = 130. The data below is a sample, the actual table runs to 1000's of rows taking the site number over 1500. 

 

I am going to use this within a further calacultion so either a column or measurt would likely do.  I have tried various MAX functions but cant work out the expresision to filter to the site numbers. Thanks, 

 

SITE_NONumberRPT_MONTH
112701/07/2017 00:00
17601/06/2017 00:00
118001/05/2017 00:00
113501/04/2017 00:00
217301/07/2017 00:00
213201/06/2017 00:00
29601/05/2017 00:00
26801/04/2017 00:00
37201/07/2017 00:00
37901/06/2017 00:00
310701/05/2017 00:00
313001/04/2017 00:00
1 ACCEPTED SOLUTION
Anonymous
Not applicable

You can create a calculated table:
Table2 = SUMMARIZE(Table1;Table1[SITE_NO];"Max Site Value";max(Table1[Number]))

 

Table1Table1Table2Table2

 

 

 

View solution in original post

3 REPLIES 3
Alan_
Advocate II
Advocate II

Both answers work perfectly - thanks! I hadn't considered a calculated summary table - this seems like the cleanest solution thank you very much. 

Anonymous
Not applicable

You can create a calculated table:
Table2 = SUMMARIZE(Table1;Table1[SITE_NO];"Max Site Value";max(Table1[Number]))

 

Table1Table1Table2Table2

 

 

 

Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @Alan_

 

Here is a calculated column that might work.

 

Max Number for Site = 
VAR SiteCol = 'Table1'[SITE_NO]
RETURN CALCULATE(
                MAX('Table1'[Number]),
                FILTER(
                    ALL('Table1'),
                    'Table1'[SITE_NO] = SiteCol
                    )
                   )

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.