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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
BiBra
Helper III
Helper III

Max value

Hello

 

I have some data, where I want to retrieve the max value from an unpivoted column. I need to retrieve the max value for each "name".  I have multiple record for each name, on different dates. What I want to get is the nmax value for each name. 

I have tried the following:

 

Max value = 
VAR myValue = [Value at recent date]
RETURN 
CALCULATE(
    Values('inStock'[ActualStart]);
    FILTER(
        ALLSELECTED('inStock'[ActualStart]);
        CALCULATE(SUM('inStock'[Value]))=myValue))

However, when trying to display the data the following fault appears: 

fault.PNG

This is no matter which visual I try to represent it in. Is there any way to make this happen?

5 REPLIES 5
SivaMani
Resident Rockstar
Resident Rockstar

@BiBra,

 

It would be great if you share sample data.

@SivaMani

 

It looks somewhat like this:

 

name               date               attribute              value

xx                   9/10-2016           hgr                     3

xx                  20/11-2016          hgr                      5

sdf                 ---                        we                       1

 

 

Where attribute and value are the unpivoted ccloumns

Value at recent date = 
CALCULATE(
    SUM('inStock'[Value]);
    FILTER('inStock';'inStock'[ActualStart] = MAX('inStock'[ActualStart])))

I have recently tried this for retrieving the latest data. I tried changing the "ActualStart" to Value. Then I tried to add another FILTER before the SUM funciton, to divide the values into dates. However this is not allowed

SivaMani
Resident Rockstar
Resident Rockstar

@BiBra,

 

If your requirement is finding max value, MaximumVal = MAX('inStock'[Value]) - this will give expected outcome.

 

Was I understood wrong? 

@SivaMani It is not only the max value, but the max value of each target/name

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors