Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

question on DAX

Hi BPI users, 

 

I have a question on Dax, I have column contains 7 product names and I want to create a Y/N column where Y = all the 7 product names and N = include  all except one product name . Is there a switch function we can use in DAX to do that 

5 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Anonymous Sure:

    Column = 
      SWITCH([Product],
        "Product No","N",
        "Y"
      )
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Greg, 

     

    The formula you suggested gives me Y= all 7 product and N= only one product.  but I want for N = all product 6 except one. This is where I am stuck 

  • Anonymous 

    Do you want to use this in the filter or calculation?

    could you pls provide the sample data and expected output?

    • Anonymous's avatar
      Anonymous
      Not applicable

      I want to use that in a filter 

      the total products I have is 

      My expected output for Y is all the 7 products together and N should have all the 6 products except the one which is left out.