Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all: Good day! I am trying to pull 3 months old data [there is a parameter, 'endDate' that will start from 3 months from today and ends at yesterday]. I am trying to replace the hard coded static query string [1st Query string below] to a dynamic query [2nd Query string]
Query="select * from NatGas_V3.natgas.pipeline_maintenance_events#(lf)where endDate >='2020-08-23' and endDate<'2020-11-23' "
Query="select * from NatGas_V3.natgas.pipeline_maintenance_events#(lf)where endtDate >=" &ThreeMonthsEarlierFilter
I have this query, ThreeMonthsEarlierFilter [Which returns ‘2020-08-23’ ]
= "'" & Date.ToText(Date.AddMonths(Date.From(DateTime.LocalNow()), -3),"yyyy-MM-dd") & "'"
I have another query [using to pull recent data], datefilter [returns today’s date]
= "'" & Date.ToText(Date.AddMonths(Date.From(DateTime.LocalNow()), -0),"yyyy-MM-dd") & "'"
My question is how do I use datefilter in the above dynamic Query string, not sure how to include the and clause and the end of query string “ to complete the Query! ☹
I would really appreciate help in this! Many thanks in advance! 🙂
Solved! Go to Solution.
Please try this string
Query="select * from NatGas_V3.natgas.pipeline_maintenance_events#(lf)where endtDate >=" &ThreeMonthsEarlierFilter & " and endDate < " & datefilter
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Please try this string
Query="select * from NatGas_V3.natgas.pipeline_maintenance_events#(lf)where endtDate >=" &ThreeMonthsEarlierFilter & " and endDate < " & datefilter
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Thanks a lot @mahoneypat for your prompt response! You did 'make my day'!🎶 Happy Thanksgiving to you all in US!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 65 | |
| 43 | |
| 40 | |
| 29 | |
| 19 |
| User | Count |
|---|---|
| 200 | |
| 126 | |
| 103 | |
| 70 | |
| 54 |