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

Import lines under conditions in Power Query

Hello Guys,

 

I have an XLS file holding data from HRs with a structure similar than the following one;

 

 2018-08-06_08-31-45.png

 

I would like to import data using some conditions based on column values as per below;

 

  1. Having a new column with Date populated with corresponding column Date type equals to
    1. CurrPosition Start, if it does not exists
    2. Entry Into Company, if it does not exists
    3. Tech.Ent.In.Company
  2. Having a system User Name
  3. All distinct Pers.Nb.

Not sure how I can achieve point 1. I did some merges but it is very heavy and I have to perform crazy conditions.

I am thinking of using unpivot and conditional column but is there a smarter way to do it in Power M Query?

 

Anyone have a suggestion?

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

HI @Anonymous,

 

AFAIK, power query excel connector not support add conditions when import data, you can only consider to import whole data and add filters to filter unmatched records.

 

Apply filter on Date type column when it equal to 'CurrPosition Start','Entry Into Company' or 'Tech.Ent.In.Company'.

13.PNG14.PNG

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @Anonymous,

 

AFAIK, power query excel connector not support add conditions when import data, you can only consider to import whole data and add filters to filter unmatched records.

 

Apply filter on Date type column when it equal to 'CurrPosition Start','Entry Into Company' or 'Tech.Ent.In.Company'.

13.PNG14.PNG

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Hi Xiaoxin Shen,

Thank you for your prompt reply, that was so simple I overlooked it... starting in PBI is funny sometimes

Enjoy your day,

David

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.