Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
hi Team,
How to sort the month in fabric?
Is there any option to sort the month in chronological order in fabric ?
Solved! Go to Solution.
@Partha2318
Or try below method create calculated columnMonth Number = MONTH('Table'[Date])
or
Month Number = FORMAT('Table'[Date],"MM")
if you use the latter , change the data type to whole number after
after you create your month number , press on the month name column and in the ribbon above in the table tools , you will find something called sort by column , press it and choose month number
I hope I answered your question!
Hi @Partha2318 ,
Thank you @Uzi2019 for the quick response and solution. I have an alternative approach for you to consider:
We can create a new table.
MyTable = DATATABLE (
"Month", STRING,
"Number", INTEGER,
{
{"January", 1},
{"February", 2},
{"March", 3},
{"April", 4},
{"May", 5},
{"June", 6},
{"July", 7},
{"August", 8},
{"September", 9},
{"October", 10},
{"November", 11},
{"December", 12}
}
)
Create the model relationship.
Select the Month column of the [MyTable] table and sort by [Number].
Place the [Month] field of the [MyTable] table instead of the [Month_txt] field of the DimDate table on the visual object.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Ensure that you have a Calendar Table with calculated column formulas for Year, Month name and Month number. Sort the Month name by the Month number. Create a relationship (many to one and single) from the Date column of your Data Table to the Date column of the Calendar Table. To your visual, drag Year and Month name from the Calendar Table.
Hope this helps.
Hi,
Ensure that you have a Calendar Table with calculated column formulas for Year, Month name and Month number. Sort the Month name by the Month number. Create a relationship (many to one and single) from the Date column of your Data Table to the Date column of the Calendar Table. To your visual, drag Year and Month name from the Calendar Table.
Hope this helps.
Hi @Partha2318 ,
Thank you @Uzi2019 for the quick response and solution. I have an alternative approach for you to consider:
We can create a new table.
MyTable = DATATABLE (
"Month", STRING,
"Number", INTEGER,
{
{"January", 1},
{"February", 2},
{"March", 3},
{"April", 4},
{"May", 5},
{"June", 6},
{"July", 7},
{"August", 8},
{"September", 9},
{"October", 10},
{"November", 11},
{"December", 12}
}
)
Create the model relationship.
Select the Month column of the [MyTable] table and sort by [Number].
Place the [Month] field of the [MyTable] table instead of the [Month_txt] field of the DimDate table on the visual object.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Partha2318
If you have month number in your data so you can sort the month by month number.
or refer below video
https://www.youtube.com/watch?v=NvFDasTzP9E
I hope I answered your question!
@Partha2318
Or try below method create calculated columnMonth Number = MONTH('Table'[Date])
or
Month Number = FORMAT('Table'[Date],"MM")
if you use the latter , change the data type to whole number after
after you create your month number , press on the month name column and in the ribbon above in the table tools , you will find something called sort by column , press it and choose month number
I hope I answered your question!
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
87 | |
87 | |
87 | |
67 | |
49 |
User | Count |
---|---|
135 | |
113 | |
100 | |
68 | |
67 |