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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
PPStar
Helper IV
Helper IV

Replace Today and Yesterday with correct dates

Hello. 

I am grabbing data into a CSV file on a daily basis. 

The date column that i want to create a relationship with my date table is coming through like ths

 

 

PPStar_1-1714384788526.png

 

How can i get Power Query to automatcally turn Today into Todays date and Yesterday into Yesterdays date? - We can remove time for now, as i just want to relate ton the date. 

Thanks for any tips

1 ACCEPTED SOLUTION

How are you getting the files is it based on the Folder?

If yes you need to go to remove the step remove other columns, then add the new column based on the creation date and after that delete all the columns that are related with the folder:

MFelix_0-1714388061676.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @PPStar ,

 

If you are getting the files from a folder just keep the column Date created or date modified after doing the function call then use a conditional column like this:

if  Text.Contains ([Star time] , "Today" ) then [Date created] else 
if  Text.Contains ([Star time] , "Yesterday" ) then 
[Date created] - #duration(1,0,0,0)
else 
[Start Time]

 

this may need to be adjusted.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



The files will be manually dropped into a folder on a daily basis.  

The Date Created column is not part of the table.. Where do i get that from. 

Can i not juts change the [Date Created] to Now()  or something similar?

How are you getting the files is it based on the Folder?

If yes you need to go to remove the step remove other columns, then add the new column based on the creation date and after that delete all the columns that are related with the folder:

MFelix_0-1714388061676.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.