Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

var + return multiple

hello    can someone help me please  i'm woindering if it's possible to have in a return clause multiple lignes  here is the code that i'm wrinting   Colonne_tes = var __tisDate = 'DimDate'[...
  • Mariusz's avatar
    6 years ago

    Hi Anonymous 

     

    if are you looking to pass multiple logical tests, then you can use SWITCH 

    columns =
    SWITCH(
        TRUE(),
        'Product'[Color] = "Red", 1,
        'Product'[Color] = "Blue", 2,
        'Product'[Color] = "Black", 4,
        3 --else 
    )

     

    btw, your question is DAX related did you wanted to recreate it in Power Query?

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn