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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Thimios
Helper II
Helper II

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

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


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

ImkeF
Super User
Super User

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.

@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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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