Forum Discussion
DAX Text Function - Change values of a text column (like a lookup table)
- Anonymous9 years ago
arelf27, it sounds like you need to talk to the people in charge of your data and ask for a sort order column to be created.
Yes, a DAX calculated column could do this (there is a SWITCH() function that would work), but you confirmed that you can't create additional calculated columns.
In short, a measure won't work. You can't put a measure on a categorical axis for a visual, Power BI won't let you. The only visual that accepts measures on the axes like that is a scatter plot.
If you can create a calc column, try this:
SortMeasure = SWITCH ( SELECTEDVALUE ( Table[Column] ), "To Do", "1-To Do", "Next", "2-Next", "WIP", "3-WIP", "Closed", "4-Closed" )
arelf27, it sounds like you need to talk to the people in charge of your data and ask for a sort order column to be created.
Yes, a DAX calculated column could do this (there is a SWITCH() function that would work), but you confirmed that you can't create additional calculated columns.
In short, a measure won't work. You can't put a measure on a categorical axis for a visual, Power BI won't let you. The only visual that accepts measures on the axes like that is a scatter plot.
If you can create a calc column, try this:
SortMeasure =
SWITCH (
SELECTEDVALUE ( Table[Column] ),
"To Do", "1-To Do",
"Next", "2-Next",
"WIP", "3-WIP",
"Closed", "4-Closed"
)
- arelf279 years ago
Helper II
I see. Thaks for replying. I'm working with data from Visual Studio Team Services (VSTS) - built a solution in PowerBI Services by connecting to their app/content pack, so it's quite limiting as to what can be done.. I thought I'd try connecting live to it in PowerBI Desktop but with that the only additional thing I can do is create measures.. Everything else is still grayed out.. (basically I don't have access to this online Content Pack database...)