Forum Discussion
Mous007
6 years agoHelper IV
Date table sorting error
Hi everyone, The extract of my current dates table: DatesTable = VAR MinYear = YEAR ( MIN ( 'Power BI users extract'[Date] ) ) VAR MaxYear = YEAR ( MAX ( 'Power BI users extract'[Date] ) ) R...
- 6 years ago
Perhaps Sequential?
https://community.powerbi.com/t5/Quick-Measures-Gallery/Sequential/m-p/380231#M116
Greg_Deckler
6 years agoCommunity Champion
Perhaps Sequential?
https://community.powerbi.com/t5/Quick-Measures-Gallery/Sequential/m-p/380231#M116
Mous007
6 years agoHelper IV
Hello there Greg_Deckler , thanks a lot for your prompt reply.
I have tried to following column based on your link but it seems that its not working;
Column =
VAR MaxWeeks = SUMMARIZE(ALL('DatesTable'[Week number]),'DatesTable'[Week number],"MaxWeek",MAX('DatesTable'[Week number]))
VAR MyYear = [Calendar Year]
VAR MyStart = SUMX(FILTER(MaxWeeks,[Calendar Year]<MyYear),[MaxWeek])
VAR firstYear = CALCULATE(FIRSTNONBLANK('DatesTable'[Calendar Year],1),ALL(DatesTable[Week number]))
VAR myNum = IF(MyYear=firstYear,[Week number],MyStart+[Week number])
RETURN myNum
and my table is still returning the following;
maybe i am not using your technique correctly or i have made an error in my dax.
Any recommendations would be appreciated.