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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Calculate the total value of a subscription

Hi all,

 

I am trying to calculate the total value of a subscription which gives me headaches ;). 

My data looks like this:

 

subscriptionStartdate lineEinddate lineamountinterval
A1-1-202031-6-2020200Month
A1-7-202031-12-2020400Month
B1-1-202031-3-2020100Quarter
B1-4-202031-12-2020500Quarter
C1-1-202031-12-20205000Year
D1-1-202031-12-20204004 weekly 

 

The output should give me

A = (6* 200) + 6*(400) = 3600

B = 100 + (3*500) = 1600

C = 5000
D = (52/4) * 400)

 

I hope you can help me

 

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

You can create a column like.

Column = 
SWITCH(
    'Table'[interval],
    "Month", DATEDIFF( 'Table'[Startdate line], 'Table'[Einddate line], MONTH ) +1,
    "Quarter", DATEDIFF( 'Table'[Startdate line], 'Table'[Einddate line], QUARTER ) +1,
    "Year", DATEDIFF( 'Table'[Startdate line], 'Table'[Einddate line], MONTH ) +1, 
    "4 weekly", ( DATEDIFF( 'Table'[Startdate line], 'Table'[Einddate line], WEEK ) + 1 ) /4
) * 'Table'[amount]

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

1 REPLY 1
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

You can create a column like.

Column = 
SWITCH(
    'Table'[interval],
    "Month", DATEDIFF( 'Table'[Startdate line], 'Table'[Einddate line], MONTH ) +1,
    "Quarter", DATEDIFF( 'Table'[Startdate line], 'Table'[Einddate line], QUARTER ) +1,
    "Year", DATEDIFF( 'Table'[Startdate line], 'Table'[Einddate line], MONTH ) +1, 
    "4 weekly", ( DATEDIFF( 'Table'[Startdate line], 'Table'[Einddate line], WEEK ) + 1 ) /4
) * 'Table'[amount]

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors