cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AGo Resolver I
Resolver I

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

Accepted Solutions
Microsoft
Microsoft

Re: MIN or MAX value of multiple calculated columns

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

Re: MIN or MAX value of multiple calculated columns

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

Helpful resources

Announcements
‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors