Forum Discussion
Need help sorting X-axis
- 1 year ago
Hi rmcgrath ,
One solution to this is creating a new calculated column for sorting. The DAX calculated column would be as follows:WeekDaySortOrder = VAR WeekNum = VALUE(LEFT('YourTable'[WeekDay], FIND("-", 'YourTable'[WeekDay]) - 1)) VAR DayNum = VALUE(RIGHT('YourTable'[WeekDay], LEN('YourTable'[WeekDay]) - FIND("-", 'YourTable'[WeekDay]))) RETURN WeekNum * 10 + DayNum
This will make a new column that turns your values such as "103-1" to 1031 and "98-2" 982. From here, we will use this new column to sort your original WeekDay column.
In your table view tab, select your WeekDay column. In the top ribbon, click on the sort by column option and select the newly created column. This will sort your original column by the new column.If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.
Thanks,Samson
Connect with me on LinkedIn
Check out my Blog
Going to the European Microsoft Fabric Community Conference? Check out my Session
Hi rmcgrath ,
One solution to this is creating a new calculated column for sorting. The DAX calculated column would be as follows:
WeekDaySortOrder =
VAR WeekNum = VALUE(LEFT('YourTable'[WeekDay], FIND("-", 'YourTable'[WeekDay]) - 1))
VAR DayNum = VALUE(RIGHT('YourTable'[WeekDay], LEN('YourTable'[WeekDay]) - FIND("-", 'YourTable'[WeekDay])))
RETURN WeekNum * 10 + DayNum
This will make a new column that turns your values such as "103-1" to 1031 and "98-2" 982. From here, we will use this new column to sort your original WeekDay column.
In your table view tab, select your WeekDay column. In the top ribbon, click on the sort by column option and select the newly created column. This will sort your original column by the new column.
If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.
Thanks,
Samson
Connect with me on LinkedIn
Check out my Blog
Going to the European Microsoft Fabric Community Conference? Check out my Session
I love the idea, but it throws an error:
- SamsonTruong1 year agoSuper User
Hi rmcgrath ,
It appears you be might be trying to do this as a measure. The code provided will only work as a calculated column.