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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
andyor
Resolver I
Resolver I

Testing date output validity

How can I test all the various Power BI date outputs to check if I'm using them valid/correct?

 

E.g. In SQL Server I can do SELECT getdate() and that will output the current date/time in the console. 

 

2 questions here:

 

1) How can I do something similar in Power BI Desktop?

2) Is there a nice place that lists all the useful date formats in Power BI e.g., Start of current day, Start of current month etc etc. 

4 REPLIES 4
MahyarTF
Memorable Member
Memorable Member

Hi,

Are you looking for the Current Day ?

If yes, you could use the Today() in your code and also you could add the below code for the Current date and First day of the Month :

"TodayDate", TODAY(),
"Start of Current Month",date(YEAR(TODAY()),Month(EOMONTH(TODAY(),0)),"01")
Appreciate your Kudos
Mahyartf

Thanks but I'm looking to find out how to pass those as Paramters. I can creat the paramaters but how can I insert them into the query through advanced editor?

 

let
    Source = Sql.Database("DataBase1", "XXX", 
    [Query="DECLARE#(tab)@return_value int#(lf)#(lf)EXEC#(tab)
    @return_value = [Reporting].[Report1]#(lf)#(tab)#(tab)
    @TimeZoneID = 1,#(lf)#(tab)#(tab)
    @TZStartDate = N'2022-09-01',#(lf)#(tab)#(tab) ---want to enter my start date parameter here 
    @TZEndDate =  N'2022-09-12',#(lf)#(tab)#(tab)  -- want to enter my end date parameter here
    @DateType = 3#(lf)#(lf)SELECT#(tab)
    'Return Value' = @return_value"])
in
    Source

Are you using the below code in PQ :

DateTime.LocalNow()

It is shown the current Date-Time

Mahyartf

But how would you know? There's no output console in PQ that I can see. I think you're not understanding 1 part of the question

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.