The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hey guys,
I got request to calculate billing amounts of our customers based on the monthly payments. Please check example table:
Customer Name | Monthly Amount | Payment Start date | Payment End date |
AAA | 100 | 1.1.2023 | (blank) |
BBB | 150 | 1.3.2023 | 31.7.2023 |
CCC | 300 | 1.8.2023 | 31.3.2024 |
DDD | 50 | 15.9.2023 (future date) | (blank) |
The result should be following table (it can be measure or calculated table - no preference). I do not prefer Power Query (due to lack of knowledge and issue with maintenance of calculation). It must calculate the monthly billing amounts from the year of Payment Start date until the end of next calendar year (current year +1). Payment end date can be blank which means not defined payment interval.
Month | Billed amount |
January 2023 | 100 /* new customer AAA, calculation starting from the year of first payment start date */ |
February 2023 | 100 |
March 2023 | 250 (100+150) /* new customer BBB */ |
April 2023 | 250 (100+150) |
May 2023 | 250 (100+150) |
June 2023 | 250 (100+150) |
July 2023 | 250 (100+150) /* expiration of customer BBB */ |
August 2023 | 400 (100+300) /* new customer CCC */ |
September 2023 | 450 (100+300+50) /* new customer DDD */ |
October 2023 | 450 (100+300+50) |
November 2023 | 450 (100+300+50) |
December 2023 | 450 (100+300+50) |
January 2024 | 450 (100+300+50) |
February 2024 | 450 (100+300+50) |
March 2024 | 450 (100+300+50) /* expiration of customer CCC */ |
April 2024 | 150 (100+50) /* only customer AAA and DDD */ |
..... | |
December 2024 | 150 (100+50) /* end of next calendar year */ |
Hope it is clear from the desired table.
Thank you for any help!
IvanS
Solved! Go to Solution.
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LeanAndPractise(Everyday) ) |
Could you guys elaborate on the values of Dates table that invloved in this solution.
Thank You
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LeanAndPractise(Everyday) ) |
Thank you @ThxAlot - this works brilliantly! Really appreciate your help and prompt response!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
97 | |
80 | |
62 | |
54 |
User | Count |
---|---|
246 | |
119 | |
114 | |
87 | |
70 |