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
misaki233
Helper II
Helper II

MAX and MIN from a measure

Hi everyone!

 

I have a table like the following data.

 

Column1Column2Measure
ADD1
BDD1
CDD1
AFF2
BFF2

“Measure” is a measure based on column2. Now I want to show min value and max value of each column1. 

 

Column1Column2Measureexpected result(MIN-MAX)
ADD11-2
BDD11-2
CDD11-1
AFF21-2
BFF21-2

How can I get the result?

 

Thank you in advance.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @misaki233 ,

You can create a measure as below:

MIN-MAX = 
VAR _min =
    MINX (
        FILTER ( ALL ( 'Table' ), 'Table'[Column1] = MAX ( 'Table'[Column1] ) ),
        [Measure]
    )
VAR _max =
    MAXX (
        FILTER ( ALL ( 'Table' ), 'Table'[Column1] = MAX ( 'Table'[Column1] ) ),
        [Measure]
    )
RETURN
    CONCATENATE ( CONCATENATE ( _min, "-" ), _max )

MAX and MIN from a measure.JPG

Best Regards

Rena

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @misaki233 ,

You can create a measure as below:

MIN-MAX = 
VAR _min =
    MINX (
        FILTER ( ALL ( 'Table' ), 'Table'[Column1] = MAX ( 'Table'[Column1] ) ),
        [Measure]
    )
VAR _max =
    MAXX (
        FILTER ( ALL ( 'Table' ), 'Table'[Column1] = MAX ( 'Table'[Column1] ) ),
        [Measure]
    )
RETURN
    CONCATENATE ( CONCATENATE ( _min, "-" ), _max )

MAX and MIN from a measure.JPG

Best Regards

Rena

harshnathani
Community Champion
Community Champion

Hi @misaki233 ,

 

 

Create 3 measures

 

min measure = CALCULATE(MINX(VALUES('Table'[Column1],[measure]),ALLSELECTED('Table'))

max measure = CALCULATE(MAXX(VALUES('Table'[Column1],[measure]),ALLSELECTED('Table'))

 

Concatenate measure = CONCATENATE(CONCATENATE([minmeasure], " - "), [max  measure])

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

amitchandak
Super User
Super User

@misaki233 , Try a new measure like

minx(filter(allselected(Table),[Column1]=max([Column1])),[Measure]) -maxx(filter(allselected(Table),[Column1]=max([Column1])),[Measure])

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
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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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.