How to generate queries in Query Editor with M Code

See attached screenshot and PBIX file, today learnt some about M-code, but missing “M-code branching” information, how the codes are to combined.

Problem : how to extend invoice data into revenue period data with M-code ? The invoiced amount need to be split into future revenue periods in months.

Not able to code it, even with the code-examples with solutions of problem of the week 4.

Thanks in advance for your help !

MRR - invoices split into period revenue2604.pbix (136.2 KB)