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
claireDePasquie
Regular Visitor

Overlap tables and extract a month column from the first row.

Hi,

I receive each week a table with this structure:

week 1   week 2  
Applicationsokko Applicationsokko
application 15040 application 13540
application 23570 application 22570
application 34235 application 389

35

I would like to create a table with columns: "week" | "application"| "ok" | "ko"

So, 2 difficulties (for me):

-> create a column "Week" with the week's number from the first line

-> "merge" the 2 tables

Could you help me?

tks!

Claire

 

1 ACCEPTED SOLUTION
ArwaAldoud
Super User
Super User

Hi @claireDePasquie 

Your table has duplicate header rows, making it difficult to analyze data properly.

This steps in Power Query also I Attached cleaned Power Query File below you can download it:

  1. Load Data into Power Query
  2. Use First Row as Headers. your header will be (week 1 Column2 Column3 week 2 Column5 Column6)
  3. Use First Row as Headers agin. Manually Rename Columns your header will be (Applications, ok_1, ko_1, Applications_2, ok_2, ko_2)
  4. Select the columns ok_1, ko_1, ok_2, and ko_2. → Unpivot Columns.
  5. Extract Week Number. → Select the "Attribute" column.Use _ (underscore) as the delimiter → Name the new column "Week".
  6. Attribute → Name the new column "Status"
  7. Delete the duplicate "Applications" column if needed.
  8. Pivot to Separate OK and KO Columns. Select the "Status" column.→ Pivot Column. In the Values Column, select "Value".

Cleaned Power Query File – Download Here]

 

If this solution was helpful, please accept it as a solution or give kudos to help other community members

 

ArwaAdoudOmer_1-1740961367012.png

ArwaAdoudOmer_2-1740961402483.png

 

View solution in original post

5 REPLIES 5
claireDePasquie
Regular Visitor

hi, 

no colum with date, just the period on the first line (and in many export I have the same issue).

But it's ok with answer above.

Tks!

ArwaAldoud
Super User
Super User

Hi @claireDePasquie 

Your table has duplicate header rows, making it difficult to analyze data properly.

This steps in Power Query also I Attached cleaned Power Query File below you can download it:

  1. Load Data into Power Query
  2. Use First Row as Headers. your header will be (week 1 Column2 Column3 week 2 Column5 Column6)
  3. Use First Row as Headers agin. Manually Rename Columns your header will be (Applications, ok_1, ko_1, Applications_2, ok_2, ko_2)
  4. Select the columns ok_1, ko_1, ok_2, and ko_2. → Unpivot Columns.
  5. Extract Week Number. → Select the "Attribute" column.Use _ (underscore) as the delimiter → Name the new column "Week".
  6. Attribute → Name the new column "Status"
  7. Delete the duplicate "Applications" column if needed.
  8. Pivot to Separate OK and KO Columns. Select the "Status" column.→ Pivot Column. In the Values Column, select "Value".

Cleaned Power Query File – Download Here]

 

If this solution was helpful, please accept it as a solution or give kudos to help other community members

 

ArwaAdoudOmer_1-1740961367012.png

ArwaAdoudOmer_2-1740961402483.png

 

Hi @ArwaAldoud ,

Tks a lot, it's perfect.

Just one last question: each week I will have new table near the previous week. Do you know if we have the possibility to automate this step:

  1. Select the columns ok_1, ko_1, ok_2, and ko_2. → Unpivot Columns.

As we'll have ok_3, ko_3...

tks a lot

Claire

I’m not entirely sure about automating this fully, but you can try adding an underscore (_) at the end of "ok" and "ko" before promoting headers. This way, Power Query may dynamically name them as ok_1, ok_2, ok_3, and so on when new weeks are added.

Give it a try and let me know if it works for you.

If this was helpful give kudos to help other community members

DiKi-I
Post Partisan
Post Partisan

Do you receive any date column/ on which date it is received?

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!

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 Kudoed Authors