Forum Discussion
Custom sorting a column from a Direct Query data source
- 1 year ago
Hi shadowsong42 ,
- you cannot create a direct relationship between a Direct Query table and a calculated table, you can import specific tables or columns from your Direct Query source.
- Once you have your reference table in Import mode, you can create a relationship between this table and the Direct Query table.
- This relationship will allow you to sort the Direct Query column based on the values in your imported reference table.
If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.
If you continue to face issues, feel free to reach out to us for further assistance!
Hi shadowsong42
Thanks for reaching out to Microsoft fabric Community Forum.
- Navigate to Home > Enter Data and input your key values along with the desired sort order. This table will be integrated directly into your PBIX model, eliminating the need for any external links.
- When updates are needed, go to Transform Data > Power Query Editor, where you can directly modify the rows or values. This approach ensures your visuals and relationships remain intact without needing to recreate anything.
- Just ensure the destination is accessible to the new owner’s workspace.
If our response addressed by the community member for your query, please mark it as Accept Answer and click Yes if you found it helpful.
Should you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!
v-aatheeque wrote:
- When updates are needed, go to Transform Data > Power Query Editor, where you can directly modify the rows or values. This approach ensures your visuals and relationships remain intact without needing to recreate anything.
How do I directly modify rows or values in Power Query Editor? If I right click on a value in the table, I can choose "replace values", which appears to be a find and replace across the whole table. But I don't see anything about adding or removing rows, or pasting new data over existing data.
- lbendlin1 year ago
Super User
That's not something you do in Power Query. You modify the data via code, not via direct edit.
- shadowsong421 year ago
Resolver I
I thought I solved it by creating a calculated table using DATATABLE, but the one to many relationship I created between my new Sort Planning LOB table and the Direct Query Product table on Planning LOB doesn't seem to be working. It's marked as active in the relationship viewer, but testing the relationship with NATURALINNERJOIN('Sort Planning LOB','Product') gives me an error saying that no common join columns were detected.
Here's the calculated table:
Sort Planning LOB = DATATABLE( "Planning LOB", STRING, "Sort", INTEGER, { { "Surface Devices", "1" }, { "Surface Accessories", "2" }, { "Xbox Console", "3" }, { "Xbox Accessories", "4" }, { "Games", "5" }, { "CnE Devices", "6" }, { "PCHW", "7" }, { "PC Hardware", "8" } } )Why isn't the relationship working?
- lbendlin1 year ago
Super User
NATURALINNERJOIN is finicky about lineage. You need to have both tables with lineage, or neither.