Forum Discussion
Anonymous
2 years agoNot applicable
Create a numbered column in a DAX created table
Hello all, I have created a new table (with only 1 column) from DAX to showcase the week numbers for my charts, however, when I add them to charts they do not go in ascending order. I try sort by...
- 2 years ago
As part of your table DAX code you could add a sorting column, something like this.
Dimensioni FINYEARWEEK = VAR Table1 = DISTINCT ( 'Toll People Labour'[FinYearWeek] ) VAR Table2 = DISTINCT ( 'AUS Casuals'[FinYearWeek] ) RETURN ADDCOLUMNS ( DISTINCT ( UNION ( Table1, Table2 ) ), "Sort", VALUE ( MID ( [FinYearWeek], 3, 2 ) ) * 100 + VALUE ( RIGHT ( [FinYearWeek], 2 ) ) )
jdbuchanan71
Super User
2 years agoAs part of your table DAX code you could add a sorting column, something like this.
Dimensioni FINYEARWEEK =
VAR Table1 =
DISTINCT ( 'Toll People Labour'[FinYearWeek] )
VAR Table2 =
DISTINCT ( 'AUS Casuals'[FinYearWeek] )
RETURN
ADDCOLUMNS (
DISTINCT ( UNION ( Table1, Table2 ) ),
"Sort", VALUE ( MID ( [FinYearWeek], 3, 2 ) ) * 100 + VALUE ( RIGHT ( [FinYearWeek], 2 ) )
)Anonymous
2 years agoNot applicable
Thank you! It worked perfectly!