Forum Discussion
Data transformation in Direct Query
Hi Anonymous
If 'Order by" clause is not allowed in sql query you are using for direct query, you can sort the multiple columns in Power query. First, connect the table with direct query (don't use order by in sql query) and then at first sort one column as PQ transformation. Then edit the code slightly by adding second column in sorting command, somthing like below:
= Table.Sort(sqltable,{{"Column1", Order.Ascending},{"Column2", Order.Descending}})
2. or Can you create a view in ssms with sorting applied as needed and direct query that sql view source? or Create an additional sql table sorted in that manner with the help of ssis or some other means (if sql view is not possible or efficient?)
Hope it helps.
- Anonymous3 years agoNot applicable
- mahenkj23 years agoSolution Sage
Hi Anonymous ,
I can use these transformations well.
Connect to sql server > select table > press Ok > sort one column > edit command to add second column.
I am using May update of Power BI, but I don't think sorting might become a limitation.
Hope it helps.