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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JohanData
Resolver I
Resolver I

Cumulative Values between 2 Dates

I have a Dimension Table, Fact Table and Date Table. 

 

In the Dimension Table you have a ProjectNr, its Price, DateSigned and ProjectEndDate. 

In the Fact Table you see when you spend on this Project (key is ProjectNr, Date and Spent Amount).

 

I'd like to see: cumulative spending values on each project, where the DateTable >= DateSigned and DateTable <= ProjectEndDate

 

File: https://1drv.ms/u/s!AvDjQoL_zmjliFW4jNoEerXTDhOu?e=0wEDfi 

 

PBI Community 20191202_3.JPG

 

3 REPLIES 3
Anonymous
Not applicable

@JohanData 


You may delete or merge this post, I will keep follow up on your new post.

 

Paul

Anonymous
Not applicable

@JohanData 

If I get you right, you could use RELATED function to compare the dates in fact table with dates dimention table.

 

cumulative spending by project no.=
CALCULATE (
    SUM ( 'Fact'[SpentAmount] ),
    FILTER (
        ALLEXCEPT ( 'Fact', 'Fact'[ProjectNr] ),
        [Date] <= EARLIER ( 'Fact'[Date] )
    ),
    'Fact'[Date] >= RELATED ( 'Dimension'[DateSigned] ),
    'Fact'[Date] <= RELATED ( 'Dimension'[ProjectEndDate] )
)

 

 

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

@Anonymous Thanks for your support. I can't make your proposed measure right. This is the contextual situation. Could you please help me out?

 

PBI Community 20191203.JPG

with the following outcome: 

 

PBI Community 20191203_2.JPG

 

I attached the files: 

https://1drv.ms/u/s!AvDjQoL_zmjliHROT3e-Y6s2FSmD?e=Ngp58E 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.