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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
6mon
Helper II
Helper II

Running total yields terrible performance

I get the results I need using this

SUMX(
    FILTER(
        ALL(DIM_DATE[THE_DATE]);
        DIM_DATE[THE_DATE] <= max(DIM_DATE[THE_DATE])
    );
    [QUANTITY]
)

but the performance is terrible. 

2019-05-01 08_50_32-DaxStudio - 2.8.4.png

The dev fact table contains a mere 2000 rows, the prod is close to 3 000 000... 

 

Are those scans 'normal' ?

 

QUANTITY is defined as such : 

QUANTITY:=
SUMX(
    GROUPBY(
        FACT_COST_RESOURCE_CATEGORY;
        FACT_COST_RESOURCE_CATEGORY[ID_DIM_ACTIVITY];
        FACT_COST_RESOURCE_CATEGORY[ID_DIM_PROJECT];
        FACT_COST_RESOURCE_CATEGORY[ID_DIM_DATE];
        "QTY";
        MINX(CURRENTGROUP();[QUANTITY_RES_CAT_PERIOD_COL])
    );
    [QTY]
)

[QUANTITY_RES_CAT_PERIOD_COL] being a semi-additive column

2 REPLIES 2
Anonymous
Not applicable

@6mon 

I think the issue is that you are using two iterators (SUMX and GROUPBY) over your Fact table in the Quantity Measure.  As a test, what happens if you just make quantity a simple SUM or a constant? If that works faster, then we have a better idea on that it's the quantity measure causing the problem.

 

I"m not sure on your dataset, but maybe using ADDCOLUMNS to a SUMMARIZE function instead of the groupby could work?  Or maybe pushing some the calculationts to Power Query so the bulk of the complexity is done at refresh time. Just thinking out loud here...

Mariusz
Community Champion
Community Champion

Hi @6mon,

Try CALCULATE version if its any better.

CALCULATE(
    [QUANTITY],
    FILTER(
        ALL(DIM_DATE[THE_DATE]);
        DIM_DATE[THE_DATE] <= max(DIM_DATE[THE_DATE])
    )
)

Hope this helps
Mariusz

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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