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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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