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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not applicable

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

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

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?

@Anonymous , 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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors