Forum Discussion
InsightSeeker
Helper III
2 years agoNeed help with DAX formula
I need help to achieve the results shown in the table below. Essentially, in the 'Category' column, if all the values are the same, then return the first value; otherwise, return 'Mix...
- 2 years ago
Hi,
This calculated column formula works
Column = if(SUBSTITUTE(SUBSTITUTE(Data[Category],"-",BLANK()),LEFT(Data[Category],SEARCH("-",Data[Category],,20)-1),BLANK())="",LEFT(Data[Category],SEARCH("-",Data[Category],,20)-1),"Mix")Hope this helps.
Anonymous
2 years agoNot applicable
I have attached a sample pbix. Hope it would be helpful.
Do you have any rows that may have blank or empty values in the Category column? This may cause this error.
InsightSeeker
Helper III
2 years agoHi Anonymous - yes i do have some cells which does not have any values, how can i handle this?