Forum Discussion
nataliesmiy1357
4 years agoHelper IV
Custom if statement
Hello! I am trying to write a switch statement (or an if statement), but it's not working correctly. I want to create an equation/statement that takes the number for the minimum no of tms (the...
TomMartens
4 years agoSuper User
Hey nataliesmiy1357 ,
using Power Query (M) here is a M snippet
if [Dim1] = "A" and [Dim2] = "B" then "this" else "that"
and the same using DAX to create a calculated column
if ( ( 'Table'[Dim1] = "A" && 'Table'[Dim2] = "B" ), "this" , "that" )
If this does not help consider creating a pbix using Power BI Desktop and uploading the file to your private onedrive or dropbox account (this is how most of us share files).
Regards,
Tom
nataliesmiy1357
4 years agoHelper IV
That idea works yes - but I'm having trouble putting it into my report. It unfilters everything when I put that measure into the table. It's not grouping the data like I wanted....
Development Status =
VAR variable1 = SELECTEDVALUE(V_TM_ModulePowerBI[ProficiencyNumber])*3
VAR variable2 = count(V_TM_ModulePowerBI[EmployeeName])*3
return
if(variable1 >= variable2, "YES", "NO")