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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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