Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I have built a model to calculate Life Time Value based on the months in which contracts are valid, but need to change the logic to compute the LTV by payment period or daily LTV.
This what I need to get as a result (this or the same set up on a daily basis, just not restricted to the calendar month structure):
I was thinking I could generate a list to get the list of days covered by the contract (instead of the list of months) in Power Query, then make a join on the date column with my date table. But I don't find a function similar to Date.StartOfMonth that would replace the month list generation:
List.Select(
List.Dates(
Date.StartOfMonth([Vertragsbeginn]),
Number.From([Vertragsende]- [Vertragsbeginn]),
#duration(1, 0, 0, 0)),
each Date.Day(_) = 1)
Basically I just need to generate the list of days based on the contract start date and taking into account the number of months in which the contract is valid.
I can't get my head around as how to get there in Power Query. How can I rewrite this or approach this in a different way?
Any help will be greatly appreciated 🙂 🙂
Solved! Go to Solution.
Hi @Berl21 ,
Based on my testing, please try the following methods:
1.Create the sample table.
2.Create the new custom column in power query.
3.Drag Enter the following formula.
List.Select(List.Dates([Start Date],Duration.TotalDays([Payment period] - [Start Date]), #duration(1,0,0,0)), each true)
4.Expand the list. The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Berl21 ,
Based on my testing, please try the following methods:
1.Create the sample table.
2.Create the new custom column in power query.
3.Drag Enter the following formula.
List.Select(List.Dates([Start Date],Duration.TotalDays([Payment period] - [Start Date]), #duration(1,0,0,0)), each true)
4.Expand the list. The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
why the end date of first row is 26th, and for the second row is 28th?
Proud to be a Super User!
User | Count |
---|---|
123 | |
76 | |
62 | |
50 | |
50 |
User | Count |
---|---|
175 | |
125 | |
60 | |
60 | |
58 |