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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Thimios
Helper III
Helper III

Cumulative value for dynamic date range

I have a Calendar table and two more tables:

1. Offer table w/columns: Offer code, Customer code, Offer value.

2. Opportunity table w/columns: Opp code, Opp Start Date, Opp End date, Customer code

I need to calculate the cumulative value of offers at any given date for valid opportunities (that is between Start and End date).

Any bright ideas?

8 REPLIES 8
dax
Community Support
Community Support

Hi @Thimios , 

I am not clear about your requirement, if possible could you please inform me more detailed information(such as your expected output and your sample data)? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Community Champion
Community Champion

Might take a look at Open Tickets, it was designed to work with date intervals. https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364#M147



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

Very similar case it discussed in my blog : https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

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
ImkeF
Community Champion
Community Champion

Hi @Thimios 

what's the relationship between your tables?
How does do the opportunities are connected to the offeres?

If you just use the customer code, then you get a cartesian product.

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Thank you @ImkeF for introducing the cartesian concept to me. This does not help though as all offers will be associated with all opportunities and I cannot see how to filter.

@Thimios ,

Can you share sample data and sample output. Make me @

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

@amitchandakHere is my pbix file so you can see the relationship setup as well.

https://drive.google.com/file/d/1YkLPpMsov7oxtN5QVzyv8_Ey8l1nTxCI/view?usp=sharing
Let me know if further info on the outcome is required.

Thank you!

Let me rephrase the case, so I can make it clearer:
Let's assume that I have typical Calendar table and a fact table with the following columns:

- Opportunity code (text field)

- Opportunity start date (date field)

- Opportunity end date (date field)

- Opportunity value (currency field)

I need to create a column chart with Calendar Hierarchy in the X axis and Values on the Y axis where each column will show the total value of opportunities that were open at that date (that is when date is between Opp start date and Opp end date).

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors