Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rocky09
Solution Sage
Solution Sage

Data order same as the Original Query

I am using Direct Query method to pull data from Oracle Server. 

 

In the Original Query, I have sorted few columns and in Query Editor, I can see the same order as in the Original Query. But, when I drag all the fields into a table report. I am not getting the data order as in the Original Query.

 

Can anyone advise, how can i get the data order as in the original query.

1 ACCEPTED SOLUTION

I found a solution.

 

What I did was, I have created a custom column and Concatenated the required columns then put that custom column and sorted.

View solution in original post

6 REPLIES 6
TomMartens
Super User
Super User

Hey,

 

I'm not sure what you mean by you don't get the same data order, I guess you are referencing the order of the rows.

 

The effect can be one of these

  • Unique Rows
    The Rows in the table are not unique, this means that numeric values will be aggregated -> 100 rows in the source table will be aggregated to 97 rows in the Power BI table visual
  • Implicit Ordering of non numeric columns

I guess you have to consider the following

  • Create a measure that sorts the rows accordingly using RANKX

 

Depending of the number of rows, ordering can be slow.

 

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Thanks Tom,

 

yes, i am referring to "order of the rows".

 

I guess, RankX won't work in Direct Query Mode.

Hey,

 

according to this list:

https://docs.microsoft.com/en-us/sql/analysis-services/tabular-models/dax-formula-compatibility-in-d...

 

RANKX is one of the not optimized functions (for direct query), I just tested it and it works. I have no idea how this will behave from a performance perspective.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Thank you again,

 

but, not working. I am getting the error that RANKX cannot be used on Direct Query.

I found a solution.

 

What I did was, I have created a custom column and Concatenated the required columns then put that custom column and sorted.

Hey, this is cool.

 

Maybe this post is of interest:

 

https://community.powerbi.com/t5/Desktop/What-Happened-To-quot-Allow-unrestricted-measures-in-Direct...

 

prior to the July release there has been an option to allow unrestricted measures (meaning allow more DAX functions in measures) using direct query.

 

Maybe you want to check if you have the "preview" feature "Composite Models" enabled.

Options -> Preview Features.

 

I tested RANKX in direct query mode against a SQL Server table without an error message.

 

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.