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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Unpivot with Direct Query

Hi,

 

Is it possible to UNPIVOT the data by using the Direct query in Power BI Desktop?

 

Thank you,

1 ACCEPTED SOLUTION

Here is a post suggesting a work around using UNION()

https://stackoverflow.com/questions/50213905/is-it-possible-to-unpivot-in-power-bi-using-dax





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


View solution in original post

9 REPLIES 9
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,
 
After my simple test, the direct connection mode is possible to unpivot columns.
unpivot_dq.PNG
 
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@V-lianl-msft , I can see data on the Query editior but when I click on the close and apply then it is saying this Query contains transformation that can't be used for Direct Query.

 

I'm not sure whether you applied action, please see below.

 

Unpivot1.PNGUnpivot2.PNG

 

Thanks

Anonymous
Not applicable

Hi @Anonymous ,

 

I found this article on internet 

https://www.newtechdojo.com/unpivot-columns-in-power-bi/

 

I have used this concept in my case and it worked. 
Please have a look.

 

best regards,

Gaurav Raj Singh 

 

 

please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@Anonymous , Thanks for your response, that article is about the unpivot the data with import mode but I need with the Direct mode connection.

 

 

kentyler
Solution Sage
Solution Sage

Is the "Unpivot Column" button grayed out ? If so you will have to do the unpivot in the datasource.





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Anonymous
Not applicable

@kentyler , Thanks for your response, The Unpivot option is not grayed out but it is not letting me apply changes on the Query editor window. I guess, it is not possible at the moment and I may need to Unpivot on the source side.

 

Here is a post suggesting a work around using UNION()

https://stackoverflow.com/questions/50213905/is-it-possible-to-unpivot-in-power-bi-using-dax





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Anonymous
Not applicable

@kentyler , Brilliant, It works for me with Union. Thank you

hi

 

can you post your Advanced editor script because ii try thie solution but i dont understand because i get some error

thx

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.