Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi everyone,
I have a column of agreements like this:
And should to combine it to this form:
The logic is simple: additional agreements were concluded during the period of the main agreement (1, 2). The rate was changed.
And in a final, I have to get the table like this one:
Does anyone have an idea how to move forward from here?
Many thanks,
Konstantin
*Data first picture:
name_client | date_start | date_end | rate | agreement |
mr_x | 01.10.2017 | 30.09.2019 | 3200 | 1 |
mr_x | 01.12.2017 | 30.09.2019 | 3400 | 1 |
mr_x | 01.01.2018 | 30.09.2019 | 3400 | 1 |
mr_x | 01.12.2018 | 30.09.2019 | 3400 | 1 |
mr_x | 01.01.2019 | 30.09.2019 | 3600 | 1 |
mrs_y | 29.03.2019 | 30.09.2019 | 3600 | 2 |
mrs_y | 01.10.2019 | 30.09.2024 | 3600 | 2 |
Hi @Anonymous ,
you can use this function to get the value from the next column and subtract a day to get the end date as a first step:
(use the group-parameters in there)
After that you can use this function to parse out the days: https://www.thebiccountant.com/2017/12/11/date-datesbetween-retrieve-dates-between-2-dates-power-bi-power-query/
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @ImkeF
thanks for your help
trying to solve it.
Please, close this tread - dublicated it by mistaken.
Continuation of the topic: https://community.powerbi.com/t5/Power-Query/Start-date-amp-end-date-in-custom-column-by-day/td-p/12...