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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

Multiple Tables

Hi 

 

I am trying to import data from an excel that has multiple tables formatted like this. Three tables are included, New Employees, Employee variations and Leaving Employees. 

 

I would like to insert another column that would classify each row as either a New Employee, Employee variations and Leaving Employees.

 

Is this possible? Appreciate anyone that can help.

 

Thanks

Mike

 

January     
New Employees     
First NameLast NameType of EmploymentStart DateJob TitleBusiness Unit
JackBeanPermanent1/02/2018Team Leader People
MikeTysonFixed term19/02/2016DriverProduction
SarahParkerPermanent26/06/2005AccountantFinance
      
Leaving Employees     
First NameLast NameType of EmploymentLeaving DateJob TitleBusiness Unit
TongLeeFixed term5/06/2013FighterFight Club
HarryPotterPermanent3/09/2016MagicianHowards
      
Employees Variations     
First NameLast NameType of EmploymentLeaving DateJob TitleBusiness Unit
AdeleShuFixed tem5/06/2013Driver LeadProduction
TomKitePermanent3/09/2016Management AccountantFinance
      
February     
New Employees     
First NameLast NameType of EmploymentStart DateJob TitleBusiness Unit
WednesdayFarPermanent1/02/2018Team Leader People
      
      
      
Leaving Employees     
First NameLast NameType of EmploymentLeaving DateJob TitleBusiness Unit
Lazy DaizyFixed term5/06/2013FighterFight Club
Mike TurnerPermanent3/09/2016MagicianHowards
LarryWilliamPermanent9/09/2016MagicianHowards
      
Employees Variations     
First NameLast NameType of EmploymentLeaving DateJob TitleBusiness Unit
JennySinghFixed term5/06/2013Driver LeadProduction
TinaDrivePermanent3/09/2016Management AccountantFinance
KateMossPermanent5/06/2013Financial AccountantFinance
1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Once you have your data in a stack you can add a conditional column that looks for the word "Employees" in the first column and grabs that value if it finds it.  After that you can use the fill down to tag all the rows.

 

let
    Source = Table,
    #"Added Conditional Column" = Table.AddColumn(Source, "Custom", each if Text.Contains([Column1], "Employee") then [Column1] else null),
    #"Filled Down" = Table.FillDown(#"Added Conditional Column",{"Custom"})
in
    #"Filled Down"

 

employee_1.jpg

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

Once you have your data in a stack you can add a conditional column that looks for the word "Employees" in the first column and grabs that value if it finds it.  After that you can use the fill down to tag all the rows.

 

let
    Source = Table,
    #"Added Conditional Column" = Table.AddColumn(Source, "Custom", each if Text.Contains([Column1], "Employee") then [Column1] else null),
    #"Filled Down" = Table.FillDown(#"Added Conditional Column",{"Custom"})
in
    #"Filled Down"

 

employee_1.jpg

Anonymous
Not applicable

Thank you jdbuchanan71 . That absolutely worked.

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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