Forum Discussion
Multi conditional switch statement
- 6 years ago
One more ) right before your RETURN statement
Multiple or Single = VAR __Table = DISTINCT( SELECTCOLUMNS( FILTER( ALL('Table'), [RMA] = EARLIER([RMA]) ), "__Problem Code",[Problem Code] ) ) RETURN IF(COUNTROWS(__Table) > 1,"Multiple","Single")
Thanks Greg. I do get two errors. When I hover over the __Table it says "Parameter is not the correct type. Cannot find name __Table.
And it says the syntax for Return is incorrect.
Any idea why this is happening?
In your VAR statement, replace the comma at the end with a )
I believe that should fix it.
- Anonymous6 years agoNot applicable
Thanks Greg - Sorry to trouble you but I still got an error. The red lines are saying 1) a syntax error with Return, and 2) the other two red lines say these are "Unexpected Expressions".
So close....!
- Greg_Deckler6 years agoCommunity Champion
One more ) right before your RETURN statement
Multiple or Single = VAR __Table = DISTINCT( SELECTCOLUMNS( FILTER( ALL('Table'), [RMA] = EARLIER([RMA]) ), "__Problem Code",[Problem Code] ) ) RETURN IF(COUNTROWS(__Table) > 1,"Multiple","Single")- Anonymous6 years agoNot applicable
That did it Greg!! Thank you so much. The Power Bi forum is seriously amazing. Everyone is so helpful. And a great learning resource as other more experienced users help folks like me with these formulas....so that we may study and learn from them.
Good stuff!