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
Anonymous
Not applicable

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
Super User

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
Super User

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

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.

Top Solution Authors
Top Kudoed Authors