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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Add Date Column Using Power Query

Hi all,

I am trying to work through survey data for a restaurant and am having trouble transforming the data. Currently, the raw data looks like this (as they are combined from multiple surveys):

 

Survey IDAttributeValue
1cleanliness4
1actionDate16/10/2023
1service3
2cleanliness4
2actionDate18/10/2023
2service5
3cleanliness1
3actionDate21/10/2023
3service5

 

Is there any way this can be done within Power Query? As you can see, there are dates in the value column. I would like an additional column that takes the action date so ultimately my desired output is:

Survey IDAttributeValueactionDate
1cleanliness416/10/2023
1service316/10/2023
2cleanliness418/10/2023
2service518/10/2023
3cleanliness121/10/2023
3service5

21/10/2023

1 ACCEPTED SOLUTION
HotChilli
Community Champion
Community Champion

Duplicate the table.

In Table1, remove the rows with 'actiondate' in Attribute (by filtering from column header)

In Table2, keep only the rows with 'actiondate' in Attribute (by filtering from column header)

--

Merge Table1 and Table2 on SurveyID and expand the new column to return the date

View solution in original post

1 REPLY 1
HotChilli
Community Champion
Community Champion

Duplicate the table.

In Table1, remove the rows with 'actiondate' in Attribute (by filtering from column header)

In Table2, keep only the rows with 'actiondate' in Attribute (by filtering from column header)

--

Merge Table1 and Table2 on SurveyID and expand the new column to return the date

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors