Forum Discussion
Return a vlaue from another column by condition
I have a column Major and I have another calculation called Filter Condition that checks to see if two of the slicers have checked before showing the values on the chart. I would like to use DAX to return the Major when the Filter Condition = "Yes" otherwise return a blank string. For example:
Value = If([Filter Condition]="Yes", myTable[Major], "")
But DAX does not allow me to use myTable[Major] in there and I can only return a measure or calculation. How else I can acheive the same result?
7 Replies
- AlB
Community Champion
Hi arashaga
Is Value a measure? If so, you cannot use a naked column like myTable[Major] directly because there is no row context and therefore DAX does not know what value in myTable[Major] to choose.
Maybe if you place myTable[Major] in the rows of a matrix visual and use [Filter Condition] as a visual level filter, showing the items with value Yes you'll get what you want? (I'm not sure I've completely understood your requirement).
- v-chuncz-msft
Community Support