cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rick_ferreira
Helper III
Helper III

Create a column with min of 5 variables.

Hi guys,

I need to built a column that the shows the min of datadiff beteween 5 columns, like:

Rick_ferreira_0-1619689440669.png

Is the any way can show the min of thoso 5 variables?

Thanks

1 ACCEPTED SOLUTION
ibarrau
Super User II
Super User II

Hi. Well this is a tricky one. You can use a lot of IF statements or you can build like a table with those and then use MIN. For example:

MINX(
    UNION(
        ROW("@VirtualColumn", a),
        ROW("@VirtualColumn", b),
        ROW("@VirtualColumn", c),
        ROW("@VirtualColumn", d),
        ROW("@VirtualColumn", e)
    ), [@VirtualColumn] 
)

That might be a way of avoid IF statement to get the minimun of the variables.

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

View solution in original post

1 REPLY 1
ibarrau
Super User II
Super User II

Hi. Well this is a tricky one. You can use a lot of IF statements or you can build like a table with those and then use MIN. For example:

MINX(
    UNION(
        ROW("@VirtualColumn", a),
        ROW("@VirtualColumn", b),
        ROW("@VirtualColumn", c),
        ROW("@VirtualColumn", d),
        ROW("@VirtualColumn", e)
    ), [@VirtualColumn] 
)

That might be a way of avoid IF statement to get the minimun of the variables.

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!