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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
cool_333
Frequent Visitor

Issues with date columns

Hi All,

I'm trying to solve this issue if anyone can help. I've saved spreadsheets on the SharePoint folder and it has the Activity ID column and date columns please see the below snippet. The issue is the end date of the most recent spread in this case 29th can be less than the previous sheet's end date, is there a way it can pick up all the dates as per the most recent spreadsheet ignoring the data of the previous sheet? In power query I've done a transformation where it should pick up the data from the most recent file however if the end date of the recent spreadsheet is less than the previous then it throws an error.

 

spread dated 28th - data until 20th Aug 2023

cool_333_0-1688134874420.png

 

spread dated 29th has data until 21st July 2023.

cool_333_1-1688134899233.png

Many Thanks

 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @cool_333 

 

Are you connecting to the SharePoint folder and combining all files data into a single query? I guess that you have already selected the most recent file as the Sample file and transformed it in "Transform Sample File" query right? If so, you need to add a custom step in the "Transform Sample File" query to select the columns. 

= Table.SelectColumns(#"previous step", Table.ColumnNames(#"previous step"))

vjingzhang_0-1688441653107.png

 

I recommend that you promote the date value row as column header, and remove the auto-generated "Changed Type" step. The "Changed Type" step changes column types based on column names, this will sometimes cause an error when combining multiple queries. Then you can go to the combined single query. If it has an error, remove its auto-generated "Changed Type" step too. You will have the expected combined result then. You can change column types later manually. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

2 REPLIES 2
cool_333
Frequent Visitor

Superrrrrrrrrrrrrrr Thank you so much it worked :)))))))))))))))))))))))))))))))

v-jingzhang
Community Support
Community Support

Hi @cool_333 

 

Are you connecting to the SharePoint folder and combining all files data into a single query? I guess that you have already selected the most recent file as the Sample file and transformed it in "Transform Sample File" query right? If so, you need to add a custom step in the "Transform Sample File" query to select the columns. 

= Table.SelectColumns(#"previous step", Table.ColumnNames(#"previous step"))

vjingzhang_0-1688441653107.png

 

I recommend that you promote the date value row as column header, and remove the auto-generated "Changed Type" step. The "Changed Type" step changes column types based on column names, this will sometimes cause an error when combining multiple queries. Then you can go to the combined single query. If it has an error, remove its auto-generated "Changed Type" step too. You will have the expected combined result then. You can change column types later manually. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.