Forum Discussion
MP-iCONN
Resolver I
5 years agoPower Query for a unique date range
Trying to get the current first day of the month minus 1 year and then current first day of the month plus 1 year for a date range using to customize my SQL query for Power BI. Any help will be g...
- Anonymous5 years ago
Hi MP-iCONN ,
Here are the steps you can follow:
1. Add Column – Custom Column.
[date] >= #date(Date.Year(DateTime.LocalNow()) -1 , Date.Month(Date.StartOfMonth(DateTime.LocalNow())), 1) and [date] <=#date(Date.Year(DateTime.LocalNow()) +1 , Date.Month(Date.StartOfMonth(DateTime.LocalNow())), 1)2. Click [Flag] and select True.
3. Result.
The data left is 2020.11.1-2022.11.1
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
5 years agoNot applicable
Hi MP-iCONN ,
Here are the steps you can follow:
1. Add Column – Custom Column.
[date] >= #date(Date.Year(DateTime.LocalNow()) -1 , Date.Month(Date.StartOfMonth(DateTime.LocalNow())), 1)
and
[date] <=#date(Date.Year(DateTime.LocalNow()) +1 , Date.Month(Date.StartOfMonth(DateTime.LocalNow())), 1)
2. Click [Flag] and select True.
3. Result.
The data left is 2020.11.1-2022.11.1
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MP-iCONN
Resolver I
5 years agoNice solution. I tried this just to see how it worked and will use this in the future. Thank you.