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
Anonymous
Not applicable

Cumulative sum between a date range from two different date ranges

Hello everyone, 

 

This is my first time using the forum so hopefully I have disobeyed any rules, apologises in advance. 

 

I am trying to sum an amount from one table based upon a date from another table. The amount can't be totalled if the production date is in the past of the install date. 

 

Here is my first Table.

Production Table

Production date

Amount

2/1/20175
2/1/201710
2/1/201850
2/1/2019500

 

here is my second table

 

Asset IDInstall Date

asset 1

1/1/2017

asset 2

1/1/2018

asset 3

1/1/2019

asset 4

1/1/2020

asset 5

1/1/2017

 

So I would expect my results as this. 

Asset IDInstall DateWhat I want

asset 1

1/1/2017565

asset 2

1/1/2018550

asset 3

1/1/2019500

asset 4

1/1/20200

asset 5

1/1/2017565

 

I have a slicer table that has a unique date range. 

 

I was trying = calculate (sum(table1[amount])), filter(allselected(table1), production date > userrelationship(production date, install date)), but that doesn't seem to work. 

 

Any ideas would be very appreciated. 

 

Thanks in advance

1 ACCEPTED SOLUTION
Nathaniel_C
Community Champion
Community Champion

Hi @Anonymous ,
Try this : 

Sum of Amounts = SUMX(Production,IF(Production[Production date]>MAX(mySecond[Install Date]),Production[Amount],0))


Sum of amountss.PNG

Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel

 

 





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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
Nathaniel_C
Community Champion
Community Champion

Hi @Anonymous ,
Try this : 

Sum of Amounts = SUMX(Production,IF(Production[Production date]>MAX(mySecond[Install Date]),Production[Amount],0))


Sum of amountss.PNG

Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel

 

 





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

Proud to be a Super User!




Anonymous
Not applicable

LEGEND!!!!! KUDOS @Nathaniel_C 

@Anonymous , you are welcome!





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

Proud to be a Super User!




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.