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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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