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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
query_lord_1
Frequent Visitor

Streamline Cumulative Total Measure

Hey Everyone,

 

I have 2 essentially identical measures that give the cumulative total of a bank account's balance based on all of the transactions as of that day. The formula is as follows:

Running Total Base Amount =
CALCULATE (
    SUM ( VW_KPI_BANK_TRANSACTION[Base Amount] ),
    FILTER (
        ALL ( VW_KPI_BANK_TRANSACTION),
        (VW_KPI_BANK_TRANSACTION[Bank Balance Transaction Date Filter]) <= MAX (VW_KPI_BANK_TRANSACTION[Bank Balance Transaction Date Filter])
    )
)
The formula works, but takes forever to load, wondering if there is any way to optimtize this formula for a shorter loading time.
 
Thanks!
2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @query_lord_1 ,

 

You may try SUMX function instead of SUM function. In general, when working with large data sets, the SUMX function is more efficient than the SUM function because it computes row by row instead of aggregating the data first.

Running Total Base Amount =
SUMX (
    FILTER (
        ALL ( VW_KPI_BANK_TRANSACTION ),
        ( VW_KPI_BANK_TRANSACTION[Bank Balance Transaction Date Filter] )
            <= MAX ( VW_KPI_BANK_TRANSACTION[Bank Balance Transaction Date Filter] )
    ),
    VW_KPI_BANK_TRANSACTION[Base Amount]
)

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

This does not fix my problem. I've tried consolidating the rows (prev 1.5m) down to just after a certain date and only using a total for each day rather than haveing all individual transactions by usng SUMMARIZE to group them by that criteria in a different table. I am now  down to 50k rows, but still takes too long to load 

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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

Top Kudoed Authors