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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Building a dynamic calculator

Hello,

 

I am trying to build a calculator that will return a measure depending of two inputs:

  • Start date (I thought of using a date picker "After")
  • Duration (1,2 or 3 years: I thought of using a What if new parameter for this)

I am using a regular calendar table and another dataset with subscription information.

 

The subscription dataset looks like this :

 

Type of planEnd of subscription
A12/25/2021
A1/13/2022
A1/18/2022
A1/23/2022
B2/3/2022
B4/26/2022
B7/12/2022
B12/25/2023
A12/25/2024
A12/25/2024
A5/4/2025
B5/13/2025
A7/12/2025

 

The measure I want to calculate is the sum of % of subscription ongoing during the input period : starting on picked date and for the duration selected (1-2-3 years)

 

The subscription dataset once pivoted looks like this (number of subscription expiring in the coming years)

 

 2021202220232024
 DecJanFebAprNovDecMayJul
A13    13
B  11111 
Grand Total13111123

 

So let's say I select 1 year from Aug 2021:

- I look at the number expiry happening in that timeframe  Aug 2021 -  July 2022 (row3)

- I count the number of month remaining till the end of the period (row1)

- Calculate a % (Number of month remaining / Number of month in the duration) (row4)

- multiply this % with the number of expiration (row5)

- get my measure with a sum of row 5

 

Row No. 20212022
1Number of month remaining for selected duration8764
2MonthDecJanFevApr
3Count of subscription A&B expiring1311
4% of time during the 1 year
(Number of month remaining / 12)
67%58%50%33%
5(A+B)* % of time0.71.80.50.3

Measure = sum of (A+B)* % of time = 3

 

For 2 years (24 months) from Aug 2021: 

 

 20212022
Number of month remaining for selected duration201918169
MonthDecJanFevAprNov
Count of subscription A&B expiring13111
% of time during the 1 year
(Number of month remaining / 24)
83%79%75%67%38%
(A+B)* % of time0.82.40.80.70.4

Measure = sum of (A+B)* % of time = 5

 

For 3 years (36 months) from Aug 2021: 

 

 2021202220232024
Number of month remaining for selected duration3231302821831
MonthDecJanFebAprNovDecMayJul
Count of subscription A&B expiring13111123
% of time during the 1 year
(Number of month remaining / 36)
89%86%83%78%58%22%8%3%
(A+B)* % of time0.92.60.80.80.60.20.20.1

Measure = sum of (A+B)* % of time = 6

 

Any insights on how to proceed to automate this?

I created a file with the same dummy data here : https://we.tl/t-8DUjTVDxaq

 

Many thanks

 

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Anonymous I would say you are on the right track with this using a What if parameter, etc.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks @Greg_Deckler 

Would you have any insights on where I should start?

Create a measure based on the new measures maybe?

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 Kudoed Authors