Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am using PBI Import from SQL Server Database to pull data for the last six months but want the start date to always be the 1st: of the month through today. This is what I have right now:
Task.CreatedDate >=DATEADD(mm, DATEDIFF(m,0,DATEADD(m,-6,GETDATE())),0)
I did not want a partial month except for the current so for example, if I were to refresh the query today and anytime the rest of the month I would want to include April 1st through current day. Then in November the query would return May 1st through the current day.
Looking for help to complete the SQL Condition if possible.
Thank you in advance
Solved! Go to Solution.
Best bet would be to simply use the function Start of Month
https://msdn.microsoft.com/en-us/query-bi/m/date-startofmonth
Pass it the date you wish, and it will return the 1st.
Sorry, ended up not needing to do this but thanks for answering!
Hi @Anonymous,
It's pleasant that your problem has been solved, could you please mark an answer to close this topic if possible?
Regards,
Daniel He
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
97 | |
78 | |
64 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |