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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
BobKoenen
Helper IV
Helper IV

Calculated Column Dax based on multiple variables to get total subscription value

Hi You all,

 

I am trying to create a column in DAX which gives me the total value of a subscription and I know what I want but not how to do it. I hope you can help me. My data looks like this:

 

CustomerValueStart dateEnd DateBilling interval Desired column of total value
A1001-1-202031-11-2020Month1100
B251-1-202031-12-20204 weekly325
C50001-6-202030-6-2020Incidental5000
D15001-4-202031-12-2020Quarterly4500

 

Sow i need a formula that depending on the Billing interval

Month = Difference in months between start date and End date * value

4 week = (Difference in Weeks between start date and End date/4 ) * Value

Incidental = value

Quarterly = Difference in quarters between start date and End Date * Value

 

I hope you can help me. 

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

hi  @BobKoenen 

You could create a column as below:

Result = SWITCH('Table'[Billing interval ],
"Month",'Table'[Value]*(DATEDIFF('Table'[Start date],'Table'[End Date],MONTH)+1),
"4 weekly",'Table'[Value]*INT(DIVIDE((DATEDIFF('Table'[Start date],'Table'[End Date],DAY)+1),7*4)),
"Incidental",'Table'[Value],
"Quarterly",'Table'[Value]*(DATEDIFF('Table'[Start date],'Table'[End Date],QUARTER)+1))

Result:

3.JPG

 

And here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
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

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi  @BobKoenen 

You could create a column as below:

Result = SWITCH('Table'[Billing interval ],
"Month",'Table'[Value]*(DATEDIFF('Table'[Start date],'Table'[End Date],MONTH)+1),
"4 weekly",'Table'[Value]*INT(DIVIDE((DATEDIFF('Table'[Start date],'Table'[End Date],DAY)+1),7*4)),
"Incidental",'Table'[Value],
"Quarterly",'Table'[Value]*(DATEDIFF('Table'[Start date],'Table'[End Date],QUARTER)+1))

Result:

3.JPG

 

And here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@BobKoenen , Create a new column like.  Change logic as per need

new column =
var _diff = datediff([start date], [end date],day)
return
switch( true(),
[Billing interval] ="Incidental", [value],
[Billing interval] ="weekly", [value]*_diff/4,
[value]*_diff
)

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors