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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Kavya_Mahesh
Regular Visitor

Calculate OPEX distributed over a period of 15 Years for multiple data entries using DAX function

Hi,

I am looking to calculate OPEX using DAX functions. 

Please find below an example of what I am trying to achieve.

Let say I have Total OPEX column from 2020 to 2025. I want to calculate the OPEX distribution for each year over 10 years ie 2035. And when I create a total Opex for 2020, 2021, 2022, up until 2035, the result should be the one highlighted with yellow.

Kavya_Mahesh_0-1743189539705.png

I would really appreciate if I can get help on this.

Regards

Mahesh

5 REPLIES 5
v-sdhruv
Community Support
Community Support

Hi @Kavya_Mahesh 
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Please feel free to contact us if you have any further questions.
Thank you

v-sdhruv
Community Support
Community Support

Hi @Kavya_Mahesh 
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Please feel free to contact us if you have any further questions.
Thank you

v-sdhruv
Community Support
Community Support

Hi @Kavya_Mahesh ,
Just wanted to check if you had the opportunity to review the suggestions provided?

If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Please feel free to contact us if you have any further questions.
Thank you

danextian
Super User
Super User

Hi @Kavya_Mahesh 

 

Your description is confusing. You want to spread OPEX over 10 years but from 2020 to 2030,  that would be 11 and so the total would be 110% of the opex value. That aside, you wil need to create a disconnected table containing a column of years to spread over and then measures referencing it.

Years = GENERATESERIES(2020, 2035, 1)
Opex Spread = 
VAR _spread =
    DIVIDE ( SUM ( 'Table'[Opex Value] ), 10 )
VAR _start =
    SELECTEDVALUE ( 'Table'[Year] )
VAR _end = _start + 10
RETURN
    IF (
        SELECTEDVALUE ( Years[Years] ) >= _start
            && SELECTEDVALUE ( Years[Years] ) <= _end,
        _spread
    )
Opex Spread Total = 
SUMX (
    SUMMARIZECOLUMNS ( 'Table'[Year], 'YearsTable'[Years], "@value", [Opex Spread] ),
    [@value]
)

danextian_0-1743233727987.png

Please see the attached sample pbix.

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Ashish_Mathur
Super User
Super User

Hi,

Share some raw data to work with.  Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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