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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Cumulative measure based on two date columns

Hi everyone!

I'm working on a datamart that contains data of Virtual Machines resources utilization. I'm trying to build a historycal visualization of this resources, based on two dates: the Create Date of the VM and its Delete Date.

 

What I want to do is show the cumulative resources consumption while this VM's were actives. I have this two dates written above, so I know the period that a VM were active.

 

I am currently using a cumulative measure to calculate this values, but I don't want to sum the resources of a inactive VM, so the formula must not consider a resource's value when a Delete Date is filled.

 

Example:

 

example1.png

 

My measure is resulting this:

 

example2.png

 

Measure:

Cumulative =
CALCULATE (
     SUM(ftInstances[qtRam])/1024;
     FILTER (
         ALLSELECTED ( 'Date' );
          'Date'[skDate] <= MAX ( ftInstances[skDate] )
   )
)

 

What I want is something like this:

 

example3.png

 

Thanks!

1 REPLY 1
avanderschilden
Resolver I
Resolver I

Hi Andre,

 

Did you try to add a second filter within CALCULATE?

Cumulative =
CALCULATE (
     SUM(ftInstances[qtRam])/1024;
     FILTER (
         ALLSELECTED ( 'Date' );
          'Date'[skDate] <= MAX ( ftInstances[skDate] )
   )
,NOT(ISBLANK('ftInstances'[DeletedDate]))
)
 
Regards,
 
Adrian
)

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.