Forum Discussion
Anonymous
6 years agoNot applicable
Complex If Then Statement
Not sure how to create this IF Then statement, any help would be appreciated. I have two variables that need to be analyzed and a new column created. Would like to know if it can be done using DA...
- 6 years ago
Hi Anonymous
there are 2 options:
1. DAX using SWITCH()
Column = SWITCH(TRUE(), ISBLANK([Prosecution Date]) && ISBLANK([Court Date]), "Unknown", ISBLANK([Prosecution Date]) && NOT(ISBLANK([Court Date])), "Court", NOT(ISBLANK([Prosecution Date])) && ISBLANK([Court Date]), "Prosec", [Prosecution Date]>[Court Date], "Prosec", "Court" )2. Power QUery Custom Column
= if [Prosecution Date] = null and [Court Date] = null then "Unknown" else if [Prosecution Date] = null and [Court Date] <> null then "Court" else if [Prosecution Date] <> null and [Court Date] = null then "Prosec" else if [Prosecution Date] > [Court Date] then "Prosec" else "Court"
Anonymous
6 years agoNot applicable
I am fairly new to Power Bi does "[]" indicate a table? All of my variables are columns in one table.
ChrisMendoza
Resident Rockstar
6 years agoAnonymous -
The documentation shows a nice explanation of syntax. https://docs.microsoft.com/en-us/dax/dax-syntax-reference.