We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi,
I'm having issues with my datetable in PQ. I'm trying to create a date table for 30 days in the past and 30 days to the future, calculated from today. For example today is 9.2021, so the Date table would be from 9.1.2021- 9.3.2021 (always 60 days).
My code is like this:
Source = Number.From(DateTime.LocalNow ())+ 30 - Number.From(#date(2020,01,01)),
#"Converted to Table" = List.Dates(#date(2020,01,01),Source,#duration(1,0,0,0)),
I can't seem to fix the start date. This will end up with 1.1.2020 to today +30 days.
Any ideas?
Solved! Go to Solution.
let
start = Date.From(Date.AddDays(DateTime.FixedLocalNow(),-30)),
dates=List.Dates(start,60,#duration(1,0,0,0))
in
dates
let
start = Date.From(Date.AddDays(DateTime.FixedLocalNow(),-30)),
dates=List.Dates(start,60,#duration(1,0,0,0))
in
dates
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 10 | |
| 8 | |
| 7 | |
| 7 | |
| 5 |