Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Concatenate a field within IF/SWITCH statement

Hello Everyone, 

I'm new to Power BI. I have created new column in my report using this SWITCH statement to group Instituitions based on below conditions.  What i want is Concat "Control Group1" with INSTITUTIONS[NAME] withing the SWITCH statement.  Tried Using CONCATENATE  and COMBINEVALUE functions as well as below method. All of those gives me " Error Message:
OLE DB or ODBC error: [Expression.Error] We couldn't fold the expression to the data source. Please try a simpler expression.." Error.. Im using Direct Query mode in My Report.

 

Appreciate If anyone can suggest me a method to concat a string with Table[ColumnName] within a SWITCH Statement

 

INSTITUTIONS GROUP= SWITCH ( TRUE (),
INSTITUTIONS[ID] = "d3a2efa8" || INSTITUTIONS[ID] = "721be8893","Control Group1" & " - " & INSTITUTIONS[NAME],
INSTITUTIONS[ID]="729dbb5a-"
|| INSTITUTIONS[ID] ="b7ea8f29"
|| INSTITUTIONS[ID] ="6d85fa58"
|| INSTITUTIONS[ID] ="1df7d3ed","Control Group2","Control Group3")

 

 

Thanks

  • Anonymous well adding the column at the source is your best bet.