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 have this great calendar table function by Matt Masson, what would be the best way to automate the date range from the dates in the data?
I am assuming i would need to get the min and max of the date in the data table? What is the best way to do this in Power Query and then pass it to this function?
thanks 🙂
https://www.mattmasson.com/2014/02/creating-a-date-dimension-with-a-power-query-script/
Proud to be a Super User!
Solved! Go to Solution.
You can summarise your date table
DateRange
let Source = Actual, #"Grouped Rows" = Table.Group(Source, {}, {{"MinDate", each List.Min([Date]), type date}, {"MaxDate", each List.Max([Date]), type date}}) in #"Grouped Rows"
Then Reference it
I've tweaked the top of the function as follows
let CreateDateTable = (optional Culture as nullable text) as table => let StartDate = DateRange[MinDate]{0}, EndDate = DateRange[MaxDate]{0}, DayCount = Duration.Days(Duration.From(EndDate - StartDate)),
You can summarise your date table
DateRange
let Source = Actual, #"Grouped Rows" = Table.Group(Source, {}, {{"MinDate", each List.Min([Date]), type date}, {"MaxDate", each List.Max([Date]), type date}}) in #"Grouped Rows"
Then Reference it
I've tweaked the top of the function as follows
let CreateDateTable = (optional Culture as nullable text) as table => let StartDate = DateRange[MinDate]{0}, EndDate = DateRange[MaxDate]{0}, DayCount = Duration.Days(Duration.From(EndDate - StartDate)),
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |