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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

New rows from columns

Hi folks,

I'm trying to create new rows from columns. Eg.:

From this:

Williamspsouza_0-1635342933669.png

 

To this:

Williamspsouza_1-1635342986127.png

Any help?

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try:

New Table = 
var _t1=SELECTCOLUMNS('Table',"Name",[Column1],"Start",[Column2],"End",[Column3])
var _t2=SELECTCOLUMNS('Table',"Name",[Column1],"Start",[Column4],"End",[Column5])
return FILTER( DISTINCT( UNION(_t1,_t2)) ,[Start]<>BLANK() && [End]<>BLANK())

Eyelyn9_0-1635752745125.png

 

Best Regards,
Eyelyn Qin
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

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try:

New Table = 
var _t1=SELECTCOLUMNS('Table',"Name",[Column1],"Start",[Column2],"End",[Column3])
var _t2=SELECTCOLUMNS('Table',"Name",[Column1],"Start",[Column4],"End",[Column5])
return FILTER( DISTINCT( UNION(_t1,_t2)) ,[Start]<>BLANK() && [End]<>BLANK())

Eyelyn9_0-1635752745125.png

 

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

TheoC
Super User
Super User

Hi @Anonymous 

 

If you go into Power Query, you can select all columns you want to unpivot. Right click on the header of one and click Unpivot Columns.

 

Hopefully gets you the results you're after.

 

All the best.

Theo

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors