Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello all,
I know this has been asked and i attempted to fix however i can not for the life of me figure out how to have a dynamic date DECLARE in my sql and transfer that to the power query. This is a live connection with direct query and i can not create views as i do not own the db.
The query (works in sql and populates in preview)
Solved! Go to Solution.
Hi @cking2019 ,
You could use below query directly in powerbi like below
select *
from dt
where d BETWEEN CAST(GETDATE() -1 AS date) and GETDATE()
Or you also could refer to Pass parameter to SQL Queries statement using Power BI for details.
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.
Hi @cking2019 ,
You could use below query directly in powerbi like below
select *
from dt
where d BETWEEN CAST(GETDATE() -1 AS date) and GETDATE()
Or you also could refer to Pass parameter to SQL Queries statement using Power BI for details.
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.
User | Count |
---|---|
8 | |
5 | |
5 | |
5 | |
4 |
User | Count |
---|---|
12 | |
10 | |
8 | |
6 | |
6 |