Forum Discussion

Yggdrasill's avatar
Yggdrasill
Responsive Resident
7 years ago
Solved

Fill down column based on values with DAX

Hi ! 

 

I have 3 columns - EVENT ID, CATEGORY and LABEL

There's always ONE Primary LABEL within every EVENT, rest is Other

16Primary
135Other
15Other
166Other
21Primary
22Other
31Other
34Primary
35Other
36Other
4888Primary
51Primary
61Primary
766Other
755Other
744Primary
733Other


This is my desired OUTPUT. Extra Column which takes the Primary value and fills down the event with that value

16Primary6
135Other6
15Other6
166Other6
21Primary1
22Other1
31Other4
34Primary4
35Other4
36Other4
4888Primary888
51Primary1
61Primary1
766Other44
755Other44
744Primary44
733Other44


This needs to be a calculated column 
Thanks for your help !

  • Hi Yggdrasill 

    Create a calculated column:

     

    NewCol =
    CALCULATE (
        DISTINCT ( Table1[CATEGORY] );
        Table1[LABEL] = "Primary";
        ALLEXCEPT ( TAble1; Table1[EVENT ID] )
    )
    

     

2 Replies

  • AlB's avatar
    AlB
    Community Champion

    Hi Yggdrasill 

    Create a calculated column:

     

    NewCol =
    CALCULATE (
        DISTINCT ( Table1[CATEGORY] );
        Table1[LABEL] = "Primary";
        ALLEXCEPT ( TAble1; Table1[EVENT ID] )
    )