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
Solved! Go to Solution.
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
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.
what is the startdate and enddate here.
If for example 201911118 means - the entire week data or else only one particular date data..
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
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!
User | Count |
---|---|
205 | |
71 | |
69 | |
57 | |
57 |
User | Count |
---|---|
251 | |
220 | |
105 | |
76 | |
74 |