Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

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;

 

 

 

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?

  • Anonymous's avatar
    Anonymous
    8 years ago

    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'.

     

     

    Regards,

    Xiaoxin Sheng

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    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'.

     

     

    Regards,

    Xiaoxin Sheng

    • Anonymous's avatar
      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