Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all,
I am trying to calculate the total value of a subscription which gives me headaches ;).
My data looks like this:
| subscription | Startdate line | Einddate line | amount | interval |
| A | 1-1-2020 | 31-6-2020 | 200 | Month |
| A | 1-7-2020 | 31-12-2020 | 400 | Month |
| B | 1-1-2020 | 31-3-2020 | 100 | Quarter |
| B | 1-4-2020 | 31-12-2020 | 500 | Quarter |
| C | 1-1-2020 | 31-12-2020 | 5000 | Year |
| D | 1-1-2020 | 31-12-2020 | 400 | 4 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
Solved! Go to Solution.
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]
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]
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.