Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
rdiazd73
Helper I
Helper I

IF with 3 conditions

hello Guys
Can i help me please, my formula don´t working well , I need a new colum with  text result/ mover/slow mover/no mover
i have 3 colums in same table,  
the one with the highest value of the 3 columns must be the one that obtains the result
 
M/S/NO MOVER =
IF('SLOW MOVERS ANALYSIS'[NO MOVER]>='SLOW MOVERS ANALYSIS'[MOVER];"NO MOVER";
IF('SLOW MOVERS ANALYSIS'[SLOW MOVER]>='SLOW MOVERS ANALYSIS'[MOVER];"SLOW MOVER";
IF('SLOW MOVERS ANALYSIS'[MOVER]>='SLOW MOVERS ANALYSIS'[SLOW MOVER];"MOVER")))
 
Captura.JPG

 

 

thanks in advance 🙂

2 ACCEPTED SOLUTIONS
az38
Community Champion
Community Champion

hi @rdiazd73 

use SWITCH()

M/S/NO MOVER =
SWITCH(TRUE();
'SLOW MOVERS ANALYSIS'[NO MOVER]>='SLOW MOVERS ANALYSIS'[MOVER];"NO MOVER";
'SLOW MOVERS ANALYSIS'[SLOW MOVER]>='SLOW MOVERS ANALYSIS'[MOVER];"SLOW MOVER";
'SLOW MOVERS ANALYSIS'[MOVER]>='SLOW MOVERS ANALYSIS'[SLOW MOVER];"MOVER";
BLANK()
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

glissando
Resolver II
Resolver II

This solution using nested IFs with AND works

 

Thanks

 

M/S/NO MOVER =

IF (

    'SLOW MOVERS ANALYSIS'[MOVER] > 'SLOW MOVERS ANALYSIS'[NO MOVER]

        && 'SLOW MOVERS ANALYSIS'[MOVER] > 'SLOW MOVERS ANALYSIS'[SLOW MOVER],

    "MOVER",

    IF (

        'SLOW MOVERS ANALYSIS'[NO MOVER] > 'SLOW MOVERS ANALYSIS'[MOVER]

            && 'SLOW MOVERS ANALYSIS'[NO MOVER] > 'SLOW MOVERS ANALYSIS'[SLOW MOVER],

        "NO MOVER",

        IF (

            'SLOW MOVERS ANALYSIS'[SLOW MOVER] > 'SLOW MOVERS ANALYSIS'[MOVER]

                && 'SLOW MOVERS ANALYSIS'[SLOW MOVER] > 'SLOW MOVERS ANALYSIS'[NO MOVER],

            "SLOW MOVER",

            BLANK ()

        )

    )

)

View solution in original post

4 REPLIES 4
glissando
Resolver II
Resolver II

This solution using nested IFs with AND works

 

Thanks

 

M/S/NO MOVER =

IF (

    'SLOW MOVERS ANALYSIS'[MOVER] > 'SLOW MOVERS ANALYSIS'[NO MOVER]

        && 'SLOW MOVERS ANALYSIS'[MOVER] > 'SLOW MOVERS ANALYSIS'[SLOW MOVER],

    "MOVER",

    IF (

        'SLOW MOVERS ANALYSIS'[NO MOVER] > 'SLOW MOVERS ANALYSIS'[MOVER]

            && 'SLOW MOVERS ANALYSIS'[NO MOVER] > 'SLOW MOVERS ANALYSIS'[SLOW MOVER],

        "NO MOVER",

        IF (

            'SLOW MOVERS ANALYSIS'[SLOW MOVER] > 'SLOW MOVERS ANALYSIS'[MOVER]

                && 'SLOW MOVERS ANALYSIS'[SLOW MOVER] > 'SLOW MOVERS ANALYSIS'[NO MOVER],

            "SLOW MOVER",

            BLANK ()

        )

    )

)

thank you  @glissando 

 

the best solution and most reliable results is :

 

M/S/NO MOVER =
IF (
    'SLOW MOVERS ANALYSIS'[MOVER] >= 'SLOW MOVERS ANALYSIS'[NO MOVER]
        && 'SLOW MOVERS ANALYSIS'[MOVER] >= 'SLOW MOVERS ANALYSIS'[SLOW MOVER];
    "MOVER";
    IF (
        'SLOW MOVERS ANALYSIS'[NO MOVER] >= 'SLOW MOVERS ANALYSIS'[MOVER]
            && 'SLOW MOVERS ANALYSIS'[NO MOVER] >= 'SLOW MOVERS ANALYSIS'[SLOW MOVER];
        "NO MOVER";
        IF (
            'SLOW MOVERS ANALYSIS'[SLOW MOVER] >= 'SLOW MOVERS ANALYSIS'[MOVER]
                && 'SLOW MOVERS ANALYSIS'[SLOW MOVER] >= 'SLOW MOVERS ANALYSIS'[NO MOVER];
            "SLOW MOVER";
            BLANK ())))

The solution using the SWITCH function is better option with the modifications below...

Thanks

 

M/S/NO MOVER 2 =

SWITCH ( TRUE (),

    SUM ( 'SLOW MOVERS ANALYSIS'[NO MOVER] ) > SUM ( 'SLOW MOVERS ANALYSIS'[MOVER] ), "NO MOVER",

    SUM ( 'SLOW MOVERS ANALYSIS'[SLOW MOVER] ) > SUM ( 'SLOW MOVERS ANALYSIS'[MOVER] ), "SLOW MOVER",

    SUM ( 'SLOW MOVERS ANALYSIS'[MOVER] ) > SUM ( 'SLOW MOVERS ANALYSIS'[SLOW MOVER] ), "MOVER",

    BLANK ()

)

az38
Community Champion
Community Champion

hi @rdiazd73 

use SWITCH()

M/S/NO MOVER =
SWITCH(TRUE();
'SLOW MOVERS ANALYSIS'[NO MOVER]>='SLOW MOVERS ANALYSIS'[MOVER];"NO MOVER";
'SLOW MOVERS ANALYSIS'[SLOW MOVER]>='SLOW MOVERS ANALYSIS'[MOVER];"SLOW MOVER";
'SLOW MOVERS ANALYSIS'[MOVER]>='SLOW MOVERS ANALYSIS'[SLOW MOVER];"MOVER";
BLANK()
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.