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
AGo
Post Patron
Post Patron

MIN or MAX value of multiple calculated columns

Is there an easy way to create a measure which returns the MIN or MAX value of MULTIPLE calculated columns?

The other way for me could be unpivoting all my calculated columns and apply MIN formula to the unpivoting resulting column. I posted another question to ask how to unpivot multiple calculated columns since I'm able to unpivot only columns of the original datasource in the query editor, but not when I have calculated columns, if it could be useful to someone else...

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @AGo,

 

According to your description, you want to get the Max or Min value of MULTIPLE calculated columns, right? Suppose your sample data is like below, and the Max value returned should be 5.

3.PNG

 

If that is the case, you can refer to the below formula:

Measure =
MAX (
    MAX (
        CALCULATE ( MAX ( Table2[Event1] ), ALL ( Table2 ) ),
        CALCULATE ( MAX ( Table2[Event2] ), ALL ( Table2 ) )
    ),
    CALCULATE ( MAX ( Table2[Event3] ), ALL ( Table2 ) )
)

Thanks,
Yuliana Gu

Community Support Team _ Yuliana Gu
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

1 REPLY 1
v-yulgu-msft
Employee
Employee

Hi @AGo,

 

According to your description, you want to get the Max or Min value of MULTIPLE calculated columns, right? Suppose your sample data is like below, and the Max value returned should be 5.

3.PNG

 

If that is the case, you can refer to the below formula:

Measure =
MAX (
    MAX (
        CALCULATE ( MAX ( Table2[Event1] ), ALL ( Table2 ) ),
        CALCULATE ( MAX ( Table2[Event2] ), ALL ( Table2 ) )
    ),
    CALCULATE ( MAX ( Table2[Event3] ), ALL ( Table2 ) )
)

Thanks,
Yuliana Gu

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

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.