Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Filtered SWITCH with blank values

The site column allows for duplicate values and I need the resulting values to be duplicated for each site.  The user column allows mixed and blank values.  I need the wanted column to reflect the mo...
  • v-juanli-msft's avatar
    v-juanli-msft
    6 years ago

    Hi Anonymous 

    Enter value(like c,d) which you'd like to use as priority into a table and keep the value on the order as you need.

    then in Transform data, add a custom column from the "value" list and extract values.

    close&&apply, create columns with dax

    Column1 = IF([User]<>BLANK(),FIND([User],[Custom],1,0))
    
    Column =
    VAR m =
        CALCULATE (
            MIN ( [Column1] ),
            FILTER (
                'Table 4',
                'Table 4'[Site] = EARLIER ( 'Table 4'[Site] )
                    && 'Table 4'[Column1] > 0
            )
        )
    RETURN
        IF (
            m <> BLANK (),
            CALCULATE (
                MIN ( 'Table 4'[User] ),
                FILTER (
                    'Table 4',
                    'Table 4'[Site] = EARLIER ( 'Table 4'[Site] )
                        && [Column1] = m
                        && [Column1] > 0
                )
            ),
            "Unconfirmed"
        )
    

    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.