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 columns using dax

Hi there,

I've created a table using data from an imported table and since I've created this table using DAX, I can't manipulate it in the power query editor. I'd like to unpivot all the columns I've created, is there a way to do this using DAX?

I created my table using selectcolumns, and created 38 columns.

Thanks in advance.

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

 

A simple example. Hope this is helpful.

Table 2 =
VAR t1 =
    SELECTCOLUMNS ( 'Table', "Date", [Date], "Store", "Store1", "Value", [Store1] )
VAR t2 =
    SELECTCOLUMNS ( 'Table', "Date", [Date], "Store", "Store2", "Value", [Store2] )
VAR t3 =
    SELECTCOLUMNS ( 'Table', "Date", [Date], "Store", "Store3", "Value", [Store3] )
RETURN
    UNION ( t1, t2, t3 )

s1.PNG

s.PNG

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Icey
Community Support
Community Support

Hi @Anonymous ,

 

A simple example. Hope this is helpful.

Table 2 =
VAR t1 =
    SELECTCOLUMNS ( 'Table', "Date", [Date], "Store", "Store1", "Value", [Store1] )
VAR t2 =
    SELECTCOLUMNS ( 'Table', "Date", [Date], "Store", "Store2", "Value", [Store2] )
VAR t3 =
    SELECTCOLUMNS ( 'Table', "Date", [Date], "Store", "Store3", "Value", [Store3] )
RETURN
    UNION ( t1, t2, t3 )

s1.PNG

s.PNG

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , I would suggest to better do what you did in DAX to create that table in power query and use unpivot there.

 

Anyways refer dax way

https://www.youtube.com/watch?v=9Xv8COs59tc

https://community.powerbi.com/t5/Desktop/Using-dax-to-unpivot-a-table/td-p/421116

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

Thanks for your reply. I understand that it is much easier to unpivote a large table using power query editor, however my table does not show in the editor as I've created it using the new table button.

 

How can I go about creating a new table so that I'm able to edit it in power query?

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors