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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
diskovered
Helper III
Helper III

changing value dynamically

How do I change this value dynamically '20191118' on a weekly basis.

This value can be any day in the current week (Monday-Sunday) using the following date format: 20191118 (yyyymmdd)

FROM [tbl].[db].[test]
WHERE '20191118' BETWEEN [start_dt] AND [end_dt]

Doesn't matter if this can be done in SQL or PowerBI. I'm open to both. Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Output the first day of the current week.  Give a try!

 

Select dateadd(wk, datediff(wk, 0, getdate()), 0) as ThisWeekStart,
format(dateadd(wk, datediff(wk, 0, getdate()), 0),'yyyyMMdd')

 

 

Eric Ji | Senior Business Intelligence Consultant
www.designmind.com

View solution in original post

3 REPLIES 3
dax
Community Support
Community Support

Hi diskovered, 

Did you mean that you want to use parameter in power bi  query, right? If so, you could try to refer to Pass parameter to SQL Queries statement using Power BI  for details. If not, please correct me and inform me more detailed information(such as your expected output).

Best Regards,
Zoe Zhi

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

venal
Memorable Member
Memorable Member

@diskovered 

what is the startdate and enddate here.

If for example 201911118 means - the entire week data or else only one particular date data..

Anonymous
Not applicable

Output the first day of the current week.  Give a try!

 

Select dateadd(wk, datediff(wk, 0, getdate()), 0) as ThisWeekStart,
format(dateadd(wk, datediff(wk, 0, getdate()), 0),'yyyyMMdd')

 

 

Eric Ji | Senior Business Intelligence Consultant
www.designmind.com

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.