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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
AT_jda_powerbi
Regular Visitor

Complex data transformation with dates and workload

Dears,

 

Firstable thank you 😉

I'm facing a difficulty for the file that i need to treat when importing in Powerbi. 

The context is the following : i need to create some KPI based on input excel containing the team workload. The input files are excel file which have these columns :

- A --> C : name and role of the team member 

- D --> : Project on which the team member will work (if the team member works on several project then there will be several lines)

- E ---> H (and more)  : workload by month depending of the project 

 

Example for John Doe :

header : Name|Surname|Role|Projects|09/2022|10/2022|11/2022 ... 

Line 2   : John   |Doe        |Arch|A          |0.2        |0.3         |0.5

Line 3   : John   |Doe        |Arch|B          |0.8        |0.7         |0.5

 

I receive 4 differents file that i need to concatenate. This is can do with PowerBI directly (and automatically). However, directly from powerbi i cannot manage the data in the table (dates are not recognized). I need to transformed the file (in VBA) before importing it with the follwoing structure :

header : Name  |Surname|Role|Projects|Dates        |Workload .

then for the previous example 

Line 2   : John   |Doe        |Arch|A         |09/2022   |0.2       

Line 3   : John   |Doe        |Arch|A         |10/2022   |0.3       

Line 4   : John   |Doe        |Arch|A         |11/2022   |0.5

Line 5   : John   |Doe        |Arch|B         |09/2022   |0.8        

Line 6   : John   |Doe        |Arch|B         |10/2022   |0.7        

Line 7   : John   |Doe        |Arch|B         |11/2022   |0.5

 

My question is the following : it it possible to do the same with powerquery ? and if yes, what could be the principle ? It is difficult to manage and excel vba and powerbi for automatic task.

 

Thanks

Julien

2 ACCEPTED SOLUTIONS
artemus
Microsoft Employee
Microsoft Employee

In power query you would select all the non-date columns, and choose Transform -> Unpivot Columns -> Unpivot other columns. This will replace the date columns with an Attribute column and a Value column. You would rename these to Dates and Workload respectivly. Then you can convert the date column to the date type.

View solution in original post

v-yalanwu-msft
Community Support
Community Support

Hi, @AT_jda_powerbi ;

As artemus said, You could select those column then unpivot.

vyalanwumsft_0-1663659611636.png

Then change the column's type and name.

vyalanwumsft_1-1663659705350.png

The final show:

vyalanwumsft_2-1663659756277.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @AT_jda_powerbi ;

As artemus said, You could select those column then unpivot.

vyalanwumsft_0-1663659611636.png

Then change the column's type and name.

vyalanwumsft_1-1663659705350.png

The final show:

vyalanwumsft_2-1663659756277.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

artemus
Microsoft Employee
Microsoft Employee

In power query you would select all the non-date columns, and choose Transform -> Unpivot Columns -> Unpivot other columns. This will replace the date columns with an Attribute column and a Value column. You would rename these to Dates and Workload respectivly. Then you can convert the date column to the date type.

Dears ! 

thank you very much !! it works perfectly. 

 

Have a nice day

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors