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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
egabriel
New Member

Cumulative value between dates of each row

Hi there, need some assistance with calculating cumulative values.
I have a table with the billings of a certain period and I need to add the values ​​that are between the dates of each row.

egabriel_0-1662380505355.png

According to the excel model, I use the two dates of each line as a calculation condition.

I found a solution, but when I use a larger database, BI crashes

Memory error: Memory Allocation failure . Try simplifying or reducing the number of queries.

 

Calculation

Accumulation =
    VAR Due date = Invoicing[Due date]
    VAR Issue = Invoicing[Issue]
    VAR Result =  
CALCULATE([SumValues],
ALL(Invoicing),
Invoicing[Issue]<=Due date,
Invoicing[Due date] >=Issue
)
Return Result
 

Can you offer any advice to fix this please?

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure whether I understood your question correctly, but please try the below whether it suits your requirement. It is for creating a calcualted column.

 

Accumulation CC =
SUMX (
    FILTER (
        Invoicing,
        Invoicing[Due date] >= EARLIER ( Invoicing[Issue] )
            && Invoicing[Issue] <= EARLIER ( Invoicing[Due date] )
    ),
    Invoicing[Value]
)

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

I am not sure whether I understood your question correctly, but please try the below whether it suits your requirement. It is for creating a calcualted column.

 

Accumulation CC =
SUMX (
    FILTER (
        Invoicing,
        Invoicing[Due date] >= EARLIER ( Invoicing[Issue] )
            && Invoicing[Issue] <= EARLIER ( Invoicing[Due date] )
    ),
    Invoicing[Value]
)

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Hello, your calculation is correct, but when I added 2 more conditions and went to update through onedrive, it presented the memory error.
Even though it's a small base of 24mb.

 

egabriel_0-1662400599171.png

 

Hi @egabriel ,

 

Refresh is a background operation that can occur when two conditions are met:

  • There is sufficient memory
  • The number of supported concurrent refreshes for the Premium capacity is not exceeded

When the conditions are not met, the refresh is queued until the conditions are favorable.

 

For a full refresh, recall that at least double the current dataset memory size is required. If sufficient memory is not available, then the refresh cannot commence until model eviction frees up memory - this means delays until one or more datasets becomes inactive and can be evicted.

 

For more information, please refer to: Optimize Microsoft Power BI Premium capacities - Power BI | Microsoft Docs

 

Please check if there is any remaining memory in the workspaces.

vyadongfmsft_0-1662452925282.png

 

Best regards,

Yadong Fang

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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