Forum Discussion

Gregory-N's avatar
Gregory-N
Regular Visitor
4 years ago
Solved

Dax Switch with multiple answers

Good afternoon,   I am trying to build a report for my client to see how many of their clients meet various safety icons. A supplier can have more than one rating per invoice and it varries per in...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Gregory-N ,

    I create a table to test according to your descriptions.

    Please try below steps:

    1. below is my test table

    Table:

    2. in power query, split a column by delimiter and split  to row(Split a column of text (Power Query) (microsoft.com))

    3. load into Power BI and  add a new column with below dax formula

     

    Column =
    SWITCH (
        'Table'[Safety Icon],
        1, "Health & Happiness",
        2, "Equity & Local Economy",
        3, "Culture & Community",
        "no"
    )
    

     

    Please refer the attached .pbix file.

     

    Best regards,
    Community Support Team_ Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.