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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
FZOU
Helper IV
Helper IV

Using power query parameters

Hi everyone,

I want to replace a static date by a power query parameter, i tried some tricks but without result i'm gonna explain it below .

 

Data source : tha static date it's marked in YELLOW below:

Sources.PNG

 

I created a power query parameter named LastDate you can see it below : 

Parameter.PNG

 

Next i tried to replace the static date by this parameter like shown below :

 

replaceParameter.PNG

 

The problem is the function #date("2021-04-30") should have 3 parameters instead of just one "LastDate" and if i add a blank #date(LastDate," "," ") it wont work it can't be converted to number !

Any one can help please ?

Thank you 🙂

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @FZOU ,

 

Since the "LastDate" parameter's type is "Date", it is not needed to use #date() function. Try this:

...
{Cube.ApplyParameter, "[!V000001]",{LastDate}},
...

 

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@FZOU One thing which may be a reason - Data type on the screen should Date ?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak  Yes even when i change it to date it's same thing the #date function expects 3 arguments fro exp #date(arg1,arg2,arg3) but i have only one #date(LastDate,?,?)
date.PNG

Icey
Community Support
Community Support

Hi @FZOU ,

 

Since the "LastDate" parameter's type is "Date", it is not needed to use #date() function. Try this:

...
{Cube.ApplyParameter, "[!V000001]",{LastDate}},
...

 

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.