Forum Discussion
Sort column in table by another column when table is from Lakehouse
I'm building a report from a semantic model sourced with tables in a lakehouse. To be honest, I'm finding the lack of data modeling, filtering, sorting tools in the Service for modeling as compared to Desktop really frustrating.
In Desktop you can select a column in a table (like week of year) and sort that by another column in the same table. That way I can have a chart by week in ascending/descending order. I know how to do this in Desktop with a date table I build in M or using DAX, but with tables sourced from a Lakehouse, I have lost that table sorting flexibility. This really puts a strain on my build as I have to go redesign how we do our Date table. Unless, is there a setting I'm missing?
I've seen similar post since a year ago, but there was no update Solved: Sort column in table by another column when table ... - Microsoft Fabric Community
Thanks to everyone who offered their help. burakkaragoz suparnababu8 WaelGouader
I discovered a new option in OneLake via Power BI Desktop. By switching to Edit in Desktop, selecting the relevant column, and expanding the "Advanced" section, you’ll find the "Sort by column" feature. This allows you to sort your Month-Year column using another column (like yyyy-mm) to ensure proper chronological order in your visuals.
7 Replies
- WaelGouaderFrequent Visitor
Hi Alaahady,
You’re right that sorting a column by another column in Lakehouse-sourced semantic models is currently limited in the Service compared to Desktop.
At the moment:
The “Sort by Column” option is not exposed in the Service UI for Lakehouse tables or direct Lakehouse semantic models.
You need to set the sort relationship before publishing:
Either in Power BI Desktop while building your semantic model,
Or by using a Date table with a sort column already aligned in your Lakehouse table.
If you need to sort “Week of Year” correctly:
✅ In your Lakehouse, add a column like WeekSort (e.g., Year * 100 + WeekOfYear) that ensures correct chronological sort order.
✅ When creating your semantic model (or if using Desktop to build it before publishing), use “Sort by Column” there before publishing to the Service.Unfortunately, there is no toggle in the Fabric Service alone to set “Sort by Column” after the model is published from Lakehouse, and yes, this is a known gap many are waiting to be improved.
Thank You - suparnababu8
Super User
Hi Alaahady
May I know which mode you are using in Power BI when pulling the data from lakehuse?
Thank you!!
- Alaahady
Helper II
- burakkaragoz
Super User
Hi Alaahady ,
You're absolutely right to be frustrated - this is one of those annoying gaps between Desktop and Service capabilities. The "Sort by Column" feature just isn't available in the Service for Lakehouse semantic models.
What's happening: When you connect directly from Lakehouse to create a semantic model, you lose a lot of the modeling flexibility you'd have in Desktop. The Service assumes your data is already "modeling-ready."
Your realistic options:
Option 1: Fix it in the Lakehouse Add a proper sort column to your week table in the Lakehouse itself. Something like:
- WeekSort = Year * 100 + WeekNumber
- This gives you 202401, 202402, etc. which sorts chronologically
Option 2: Use Desktop as an intermediary
- Import from Lakehouse into Desktop
- Set your sort relationships there
- Publish that semantic model to Service
- Yeah, it's an extra step but gives you full control
Option 3: Build your date logic differently Instead of "Week of Year," use actual week start/end dates that naturally sort correctly.
The gap you're hitting is real and lots of people are complaining about it. Microsoft really needs to add more modeling tools to the Service, especially for Lakehouse scenarios.
For now, Option 1 is probably your cleanest path forward if you want to stick with direct Lakehouse semantic models.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
This response was assisted by AI for translation and formatting purposes.
- Alaahady
Helper II
Thanks to everyone who offered their help. burakkaragoz suparnababu8 WaelGouader
I discovered a new option in OneLake via Power BI Desktop. By switching to Edit in Desktop, selecting the relevant column, and expanding the "Advanced" section, you’ll find the "Sort by column" feature. This allows you to sort your Month-Year column using another column (like yyyy-mm) to ensure proper chronological order in your visuals.
- v-veshwara-msft
Community Support
Hi Alaahady ,
Thanks for the update and good to know that switching to Model view allows you to use the Sort by Column option. Appreciate you sharing it here, as it will definitely help others facing similar scenarios.
If possible, please mark your response as the Accepted Solution so others can find it more easily.
Please continue using the Fabric Community for any further queries.
Thank you.
- Alaahady
Helper II
Thank you.
In my date table, I have a column with Month-Year values such as "Jan 2025", "Feb 2025", and "Mar 2025". However, when I use this column in visualizations, the data is sorted alphabetically rather than chronologically (e.g., "Apr 2025", "Aug 2025", "Dec 2025", "Feb 2025").
To address this, I’ve created a separate column in the format yyyy-mm (e.g., "2025-01", "2025-02") specifically for sorting purposes. This approach works well in other environments, but I’m unable to use this sort column effectively within OneLake.
What is the recommended best practice in OneLake for ensuring proper chronological sorting of Month-Year values in visualizations?