concatenate within switch()
2 TopicsRequest help with Concatenating the results in a single row
Hi, I have a Depts Lookup table and a master data in my data model as shown below. I have created a measure using SWITCH statement to get the status depending on the delta between plan vs actuals. The measure I used is as below : Status = Switch( True(), Master_Data[Delta%]> 0 && Master_Data[Detla 2 Wks%]>0, "Already Overbudget, yet adding to +ve Delta", Master_Data[Delta%]< 0 && Master_Data[Detla 2 Wks%] <0, "Already Underbudget, yet adding to -ve Delta", Master_Data[Delta%]> 0 && Master_Data[Detla 2 Wks%]< 0, "Improvements to +ve Delta", Master_Data[Delta%]<0 && Master_Data[Detla 2 Wks%]>0, "Improvements to -ve Delta" ) Here Delta% is the measure for calculating % difference between plan vs actuals for the entire period, Delta 2 Wks% is the measure for calculating % difference between plan vs actuals for the last 2 weeks. I am able to get the status output as per below table 1 in Power BI, but I need to present the results as per table 2 provided below could you please help.. Output I am able to get (table 1) : Function Mapping Status Design Already Overbudget, yet adding to +ve Delta DV Already Overbudget, yet adding to +ve Delta PD Already Overbudget, yet adding to +ve Delta SET Already Overbudget, yet adding to +ve Delta SPT Improvements to +ve Delta DFT Improvements to -ve Delta Output Required (table 2) : Status Function Already Overbudget, yet adding to +ve Delta Design,DV,PD,SET Already Underbudget, yet adding to -ve Delta - Improvements to +ve Delta SPT Improvements to -ve Delta DFT Thank You, Rajesh DivateSolved570Views0likes2CommentsConcatenate a field within IF/SWITCH statement
Hello Everyone, I'm new to Power BI. I have created a new column in my report using this SWITCH statement to group Institutions based on the below conditions. What I want is Concat "Control Group1" with INSTITUTIONS[NAME] within 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. I'm 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 RushiS1.9KViews0likes1Comment