Forum Discussion
abelbb
3 years agoRegular Visitor
ordering months
i have the above column in my dataset table and August to December represent a different year from the January to December and onwards. How do i creat a custom column that sorts the months acco...
- 3 years ago
Hi, abelbb
You can try the following methods. In the Power Query, add index column:
Column:
Count = CALCULATE(COUNT('Table'[Month]),FILTER('Table',[Index]<=EARLIER('Table'[Index])&&[Month]=EARLIER('Table'[Month])))Date = DATEVALUE(2023-[Count]&"/"&'Table'[Month]&"/"&"1")Sort = YEAR([Date])*100+MONTH([Date])Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-zhangti
3 years agoCommunity Support
Hi, abelbb
You can try the following methods. In the Power Query, add index column:
Column:
Count = CALCULATE(COUNT('Table'[Month]),FILTER('Table',[Index]<=EARLIER('Table'[Index])&&[Month]=EARLIER('Table'[Month])))Date = DATEVALUE(2023-[Count]&"/"&'Table'[Month]&"/"&"1")Sort = YEAR([Date])*100+MONTH([Date])
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.