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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
merlingsf
Frequent Visitor

Max value from two columns - Show blanks

Hi,

 

I am having trouble geting a single max value for a row from three columns in a matrix.

 

The columns are: Name, Date(Month), Price

The Dataset:

 

NameMonthPrice
AJanuary75.000
AJanuary150.000
AMarch250.000
BJanuary350.000
BJanuary175.000
BMarch150.000
CMarch75.000
CMarch65.000
CJanuary125.000

 

A simple Max() Formula will result in:

NameJanuaryMarchTotal (Max)
A150.000250.000250.000
B350.000150.000350.000
C125.00075.000125.000
Total (Max)350.000250.000 

 

What I am aiming for:

NameJanuaryMarchTotal (Max)
A 250.000250.000
B350.000 350.000
C   
Total (Max)350.000250.000 

 

So, it should show a blank when the the Max value is not valid in this context. C does not have the max price in either January or March hence blank.

 

Any suggestions?

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @merlingsf ,

 

We can try to create a measure to meet your requirement:

 

Measure =
SUMX (
    DISTINCT ( 'Table'[Month] ),
    VAR result =
        MAXX (
            CALCULATETABLE ( DISTINCT ( 'Table'[Name] ), ALLSELECTED () ),
            CALCULATE ( MAX ( 'Table'[Price] ) )
        )
    RETURN
        IF ( CALCULATE ( MAX ( 'Table'[Price] ) ) = result, result, BLANK () )
)

 

1.jpg

 


By the way, PBIX file as attached.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lid-msft
Community Support
Community Support

Hi @merlingsf ,

 

We can try to create a measure to meet your requirement:

 

Measure =
SUMX (
    DISTINCT ( 'Table'[Month] ),
    VAR result =
        MAXX (
            CALCULATETABLE ( DISTINCT ( 'Table'[Name] ), ALLSELECTED () ),
            CALCULATE ( MAX ( 'Table'[Price] ) )
        )
    RETURN
        IF ( CALCULATE ( MAX ( 'Table'[Price] ) ) = result, result, BLANK () )
)

 

1.jpg

 


By the way, PBIX file as attached.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-lid-msft,

 

Thank you so much for taking the time to look at this.

 

This seems to solve the problem.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors