Forum Discussion

kalkhudary's avatar
kalkhudary
Helper IV
3 years ago
Solved

Dax formula for matching string values between different columns for conditional formatting purposes

Hello Community,    I am trying to dax the following logic to be able to use it as a conditional format on a matrix table " Project Column" under the below logic. So the logic says if the project m...
  • v-yueyunzh-msft's avatar
    v-yueyunzh-msft
    3 years ago

    Hi , kalkhudary 

    According to your dax code , you try to return 1/0 according to the different situation. For your need , you can try to use this dax code:

    SWITCH(TRUE(),
    MAX('Table1' [Project])= "Creativity" && MAX('Table1' [Project Subtype]) in {"ABCD","Crafts","CDO", "PR", "MF 6"} , 0,
    MAX('Table1' [Project])= "Toys" && MAX('Table1' [Project Subtype]) = "Lego" , 0 ,
    MAX('Table1' [Project])= "Online Gaming" && MAX('Table1' [Project Subtype]) = "Avengers",0,1
    )

     

    As the differnt data structure and differnt content filter may need to use differnt dax code . And i have no sample data . If this dax code can not meet your need , you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

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