cancel
Showing results for
Did you mean:
AGo 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

## 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. 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. 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. 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.

Announcements #### Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section. #### April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights. Top Solution Authors
Top Kudoed Authors
Users online (1,285)