Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

How to recreate Tableau conditional functions in Powerbi? (See example)

Hello,

 

I am new in Powerbi and I would like to create the following Tableau function  in Powerbi.

If [account]="A"

or [account]="B"

or [account]="C"

then [A/B/C Goal/Event Ratio]

 

ELSEIF [account]="D"

then[D Goal/Event Ratio]

 

ELSEIF [account]= "E"

Then [E Goal/Event Ratio ]

END

 

 

I know that there is an option for conditional column. However, in my case I am using a table created inside Powerbi by unioning different queries.

 

Please someone can help me with this?

 

Thank you

  • Anonymous , Try  like

     

    Switch( True() ,
    [account] in {"A","B","C"} , [A/B/C Goal/Event Ratio],
    [account]="D",[D Goal/Event Ratio],
    [account]= "E", [E Goal/Event Ratio ]
    )

2 Replies

  • Anonymous , Try  like

     

    Switch( True() ,
    [account] in {"A","B","C"} , [A/B/C Goal/Event Ratio],
    [account]="D",[D Goal/Event Ratio],
    [account]= "E", [E Goal/Event Ratio ]
    )

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you