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.
In Power Query I have appended my data tables, kept the date columns, merged them into a single column and de-duplicated it - keeping a list of all the dates in my data. This table is called 'Date'. It happens to include data from today.
Next, I created a date list using the MIN and MAX of the 'Date' table, and this list contains every single day between the min and max dates in my dataset.
However, the m query I stole from a website seems to remove today's date (or the max date in the 'Date' table), and whenever I play with the code, it breaks my list.
Below is my code, can you please help me include todays date? (or - the max date in the 'date' table - not sure which is causing the issue)
= List.Dates(List.Min(Date[DATE]),Duration.Days(List.Max(Date[DATE])-List.Min(Date[DATE])),#duration(1,0,0,0))
Solved! Go to Solution.
You need to add 1 to the second parameter...
= List.Dates(List.Min(Date[DATE]),Duration.Days(List.Max(Date[DATE])-List.Min(Date[DATE])+1),#duration(1,0,0,0))
You need to add 1 to the second parameter...
= List.Dates(List.Min(Date[DATE]),Duration.Days(List.Max(Date[DATE])-List.Min(Date[DATE])+1),#duration(1,0,0,0))
Hi @bcdobbs THANK YOU!! I had to make a minor amendment to your code, but this works! 😁
= List.Dates(List.Min(Date[DATE]),Duration.Days(List.Max(Date[DATE])-List.Min(Date[DATE]))+1,#duration(1,0,0,0))
Take simple case:
3rd Jan - 2nd Jan = 1 because it compares both at midnight.
You then start a day list starting on 2nd Jan with 1 day in it so you only get 2nd Jan.
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 |
---|---|
109 | |
98 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |