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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
ScripTeapot_
Frequent Visitor

How to union multiple columns in a new table

I need help to order this data in a new table; I made a mock data to exemplify how they gave me the data.

Captura de pantalla 2023-05-15 014004.png

The thing is, in january a certain amount of clients were charged for a number of day of service but they not necessarily paid in january. The same for the charged period of february and march. I need to order all the payment columns and all the dates columns into one column for each one; all the jan dates and amount first, the feb next and so on. Also, I need to identify from what month charged is. Like the next example:

Captura de pantalla 2023-05-15 014749.png

The amount of clients may differ one month from another, so a need the blank spaces to see who has not paid.

I need this data in a new table to visualize correctly.

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @ScripTeapot_ 

Better to use poerr query to unpivot these columns. The column headers will become attributes in the Attribute column and the values will be in the Value column 

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

Hi @ScripTeapot_ 

Better to use poerr query to unpivot these columns. The column headers will become attributes in the Attribute column and the values will be in the Value column 

I already try this, but it didn't work. I try unpivot the payment columns but the dates interact in a strange way. I had a similar case a few months ago but I don't know why it does not work now.

@ScripTeapot_ 
Then split it into 3 queries each one Date and one Value column then append the 3 queries.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors