Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
wmcclure
Helper I
Helper I

Trying to Predict Monthly/Quarterly/Yearly Payments using DAX

Hello all! 

My colleague and I are trying to find a way to calculate the expected payments accross all of our subscriptions throughout a given timeframe using the following variables
 - The Start Date for the subscription

 - The End Date of the subscription

 - The Billing Cycle (Monthly, Quarterly, or Yearly)
 - The Amount to be billed on each cycle

 

For now, I will focus only on monthly billing, as the other I imagine will use the same logic for the most part.

If I have 3 contracts,
 - one beginning on 1/1/2024 with $100 monthly payments
 - one beginning on 2/1/2024 with $150 Monthly Payments

 - one beginning on 3/1/2024 with $200 Monthly Payments

I would expect a visual showing a MRR of $100 for January, $250 for February, and $450 for March. However, the functions I have been experimenting with all seem to only show the payment on the starting month of each contract (Jan $100, Feb $150, mar $200)

 

The end result we are looking for is to have a stacked bar chart visual that shows the total expected (upcoming) payments for active contracts for each billing cycle type. Are there any resources someone can point me to for solving this? Thanks in advance for any and all advice!

1 ACCEPTED SOLUTION
v-denglli-msft
Community Support
Community Support

Hi @wmcclure,

 

Based on the information you provided I created the following data table and a calendar table (containing dates throughout the year 2024).

vdengllimsft_0-1726119688690.png

 

 

You can use the following DAX to create MRR measures.

MRR = CALCULATE(
    SUM(Subscriptions[Amount]),
    FILTER(
        Subscriptions,
        Subscriptions[Start Date]<=MAX('Calendar'[Date]) && Subscriptions[End Date]>=MIN('Calendar'[Date])
    )
)

 

Create a stacked column chart using the MRR measure values and the date column in the calendar table.
This chart shows the expected monthly MRR for 2024.

vdengllimsft_1-1726119730242.png

 

Please see the attached PBIX for reference.

 

Best Regards,

Dengliang Li

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-denglli-msft
Community Support
Community Support

Hi @wmcclure,

 

Based on the information you provided I created the following data table and a calendar table (containing dates throughout the year 2024).

vdengllimsft_0-1726119688690.png

 

 

You can use the following DAX to create MRR measures.

MRR = CALCULATE(
    SUM(Subscriptions[Amount]),
    FILTER(
        Subscriptions,
        Subscriptions[Start Date]<=MAX('Calendar'[Date]) && Subscriptions[End Date]>=MIN('Calendar'[Date])
    )
)

 

Create a stacked column chart using the MRR measure values and the date column in the calendar table.
This chart shows the expected monthly MRR for 2024.

vdengllimsft_1-1726119730242.png

 

Please see the attached PBIX for reference.

 

Best Regards,

Dengliang Li

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.