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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Kolumam
Post Prodigy
Post Prodigy

Need help on calculating annual contract (DAX) [Stuck for Days]

Hi All,

 

I have the below table.

 

Start Date of ContractEnd Date of ContractOperation NameComprehensive O&M Price
1/7/201931/8/2019X375
1/9/201931/3/2020X405
12/5/202031/12/2021X385
1/4/201731/3/2018Y380
1/4/201831/3/2020Y410
11/5/202031/12/2021Y303

 

Based on the start date of contract and end date of contract for each Operation Name, I need to calculate the annual contract for each operation name.

 

Expected Output with Calculation: 

 

Operation NameYearAnnual ContractCalculation
X2019395(375*60/180)+(405*120/180)
X2020353.01(405*90/365)+(385*240/365)
X2021385(385*365/365)
Y2017380(380*365/365)
Y2018396.97(380*90/365)+(410*270/365)
Y2019410(410*365/365)
Y2020300.23(410*90/365)*(303*240/365)
Y2021303303*365/365

 

Please find my explanation for the calculation.

(375*60/180)+(405*120/180)

Here 60 is the number of days for which the contract is valid (end date - start date) and 180 is the total number of days between 1 July 2019 and 31st December 2019. I am using the days approximately but ideally it should be the exact number of days.

For this one: (405*90/365)+(385*240/365)

90 because the contract is from 1st Jan 2020 to 31 March 2020 and 240 is because the the start date is 12/5/2020 and ends at 31st Dec 2020. I am taking rough numbers. Not the exact difference in days.

For the last contract, the contract applies for whole year. Hence 385*365/365

Thanks in advance for the help.

 

 @parry2k @mahoney19  @parry2k @az38 @jdbuchanan71 @mahoneypat @edhans @harshnathani @v-kellya-msft @MFelix @Ashish_Mathur @BA_Pete @ryan_mayu @kbuckvol @Alexander76877 @Petazo @Mariusz @TomMartens @Greg_Deckler @tjd @Sean @mikstra @AllisonKennedy @EricHulshof @briandpeterson @USG_Phil @vpatel55 @mwegener @v-piga-msft @tex628 @sturlaws @Vvelarde @CheenuSing @MarcelBeug @Zubair_Muhammad @v-piga-msft @danextian @MattAL @MattAllington @roalexan @Alexander76877 @kgc 

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

hi  @Kolumam 

You could refer to this same blog:

https://community.powerbi.com/t5/Quick-Measures-Gallery/Periodic-Billing/m-p/409365

 

The only difference is why denominator is 180 or 360 in your case.

 

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.
lbendlin
Super User
Super User

That is a true nightmare. I would go down to the day level and for each operation and day calculate the day's contract value.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.