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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
WonderCoding
Frequent Visitor

Create index column in DirectQuery mode

Hi all!

 

I have a simple problem that I can't find a way to solve and I haven't found anything related online. I have sorted data imported using DirectQuery mode and I need to create a index column, yet I can't use the add index column functionality as it only works on import mode.


Any way to add an index column in PowerQuery or do I need to add it on the source?

 

Best regards.

3 REPLIES 3
amitchandak
Super User
Super User

@WonderCoding , I doubt you can add that in direct query mode, Maybe add rank or row number in a database query

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello @amitchandak,

 

Thanks for the reply. Will try using rank and last case I will go to the source.

 

When you say row number in a database query are you refering to importing the data using a SQL statment that adds the index?

@WonderCoding , for a few databases you can write a query in the direct query mode too, In that case, you can use some functions like row_number etc

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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