cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ronpadz Regular Visitor
Regular Visitor

How to add custom column to query that populates today's date?

I want to create a custom column in a load query that reflects the date the data was loaded, but when attempting to use Today() or Now() an error is returned. How should this be done?

2 REPLIES 2

Re: How to add custom column to query that populates today's date?

How to create a column containing today's date depends on the source of the query.  If the query is from SQL Server the query would be something like Select column1, getdate() as Loaddate from tableY

Super User
Super User

Re: How to add custom column to query that populates today's date?

In the query, create a new column and use

DateTime.LocalNow()

 

From:

https://support.office.com/en-us/article/DateTime-LocalNow-Applies-to-Power-Query-567827c0-d7d8-441b...

 

In DAX, use:

=TODAY()

 

 

Of course, that would be a bad idea to use TODAY() in DAX for what you want, as I am sure you have already realized.

 

 


I have book! Learn Power BI from Packt


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

Proud to be a Datanaut!

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)