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.
Greeting All,
Id | Start Date | Date Master |
1 | 01/05/2021 | 01/05/2021 |
1 | 01/05/2021 | 02/05/2021 |
1 | 01/05/2021 | 03/05/2021 |
1 | 01/05/2021 | 04/05/2021 |
1 | 01/05/2021 | 05/05/2021 |
1 | 01/05/2021 | 06/05/2021 |
1 | 01/05/2021 | 07/05/2021 |
1 | 01/05/2021 | 08/05/2021 |
1 | 01/05/2021 | 09/05/2021 |
1 | 01/05/2021 | 10/05/2021 |
1 | 01/05/2021 | 11/05/2021 |
1 | 01/05/2021 | 12/05/2021 |
1 | 01/05/2021 | 13/05/2021 |
1 | 01/05/2021 | 14/05/2021 |
1 | 01/05/2021 | 15/05/2021 |
1 | 01/05/2021 | 16/05/2021 |
1 | 01/05/2021 | 17/05/2021 |
1 | 01/05/2021 | 18/05/2021 |
1 | 01/05/2021 | 19/05/2021 |
1 | 01/05/2021 | 20/05/2021 |
1 | 01/05/2021 | 21/05/2021 |
1 | 01/05/2021 | 22/05/2021 |
1 | 01/05/2021 | 23/05/2021 |
1 | 01/05/2021 | 24/05/2021 |
1 | 01/05/2021 | 25/05/2021 |
1 | 01/05/2021 | 26/05/2021 |
1 | 01/05/2021 | 27/05/2021 |
2 | 11/05/2021 | 11/05/2021 |
2 | 11/05/2021 | 12/05/2021 |
2 | 11/05/2021 | 13/05/2021 |
2 | 11/05/2021 | 14/05/2021 |
2 | 11/05/2021 | 15/05/2021 |
2 | 11/05/2021 | 16/05/2021 |
2 | 11/05/2021 | 17/05/2021 |
2 | 11/05/2021 | 18/05/2021 |
2 | 11/05/2021 | 19/05/2021 |
2 | 11/05/2021 | 20/05/2021 |
2 | 11/05/2021 | 21/05/2021 |
2 | 11/05/2021 | 22/05/2021 |
2 | 11/05/2021 | 23/05/2021 |
2 | 11/05/2021 | 24/05/2021 |
2 | 11/05/2021 | 25/05/2021 |
2 | 11/05/2021 | 26/05/2021 |
2 | 11/05/2021 | 27/05/2021 |
I have used the below query for 100days but I want to add today() function instead of 100.
Date Master=List.Dates([Start Date], 100, #duration(1, 0, 0, 0))
Please help to change this Query.
Thank you,
askspepsi
Solved! Go to Solution.
@askspepsi
Your formula is creating a list of dates from [Start Date] with 100 days. IF not 100 days, what exactly is required there?
Today is a Date, you a number. if you need today's date in PQ Date.From(DateTimeZone.LocalNow())
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@askspepsi
Your formula is creating a list of dates from [Start Date] with 100 days. IF not 100 days, what exactly is required there?
Today is a Date, you a number. if you need today's date in PQ Date.From(DateTimeZone.LocalNow())
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
You are correct, my formula is creating for 100days, but for time being and to make the formula work I kept as 100days, but in reality, it should take today's date for example:- one employee starts from May 1st, 2021 then the date master should have 1st May 2021 to 27th May 2021 and when it is tomorrow the date master should be 1st May 2021 to 28 May 2021.
As you said to use Date.From(DateTimeZone.LocalNow()),
My Formula is now working fine, Thank you.
List.Dates([Start Date], Duration.Days(Date.From(DateTimeZone.LocalNow()) -[Start Date])+1 , #duration(1, 0, 0, 0))
@askspepsi , Try like
Date Master=List.Dates([Start Date], Duration.Days(today() -[Start Date]) , #duration(1, 0, 0, 0))
I have got the below error
Expression.Error: The name 'today' wasn't recognized. Make sure it's spelled correctly.
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |