Forum Discussion
Lio123
Advocate I
23 days agoHelp with DAX
Dear Pros, Need help here I have a monthly recurring charge (MRC) from multiple customers that continues every month until the end of their contracts. I want to calculate the MRC amount for each ...
- 19 days ago
Hi Lio123,
As per your requirements, I tried to create cumulative sum and please find the attached pbix file with that solution.
Best Regards,
Maruthi
techies
Super User
21 days agoHi Lio123
You can materialize it as a calculated table like this:
Bridge_MRC = SELECTCOLUMNS( GENERATE( Fact_MRC, VAR NumMonths = Fact_MRC[ContractMonths] VAR MonthStart = DATE( YEAR( Fact_MRC[MRCStartDate] ), MONTH( Fact_MRC[MRCStartDate] ), 1 ) RETURN ADDCOLUMNS( GENERATESERIES(0, NumMonths - 1, 1), "BillingMonth", EDATE(MonthStart, [Value]) ) ), "CustomerID", Fact_MRC[CustomerID], "MRCAmount", Fact_MRC[MRCAmount], "BillingMonth", [BillingMonth], "MonthYearSort", YEAR([BillingMonth]) * 100 + MONTH([BillingMonth]) )
one row per customer per billed month, using ContractMonths to drive the expansion, then relate BillingMonth to your Date table and just SUM() in the measure.