Is there a way to do a case statement inside of Power BI, specifically written in M?
I have columns that look like this:
col_a col_b col_csteve smith steve smithnull james jamessally null sallyCol_c is a concatenation of columns a and b. If column a or b are null, then I want column c to be null, no matter what.
Any suggestions?
Best Answer
M has a fairly standard if, then, else syntax.
if [col_a] = null or [col_b] = nullthen nullelse [col_a] & " " & [col_b]