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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
lucmax
Helper II
Helper II

Performance problem with measure

Hi all,

 

I am trying to get a measure working to get information about the average cumulative duration of sorted data. 

The following two tables are used:

Log:

lucmax_2-1618161091408.png

 

Cases:

lucmax_1-1618160842358.png

 

Expected result in a matrix:

lucmax_3-1618161219158.png

lucmax_5-1618161505017.png

 

 

This works fine with the following when DurationAtStart is the following measure until I work with a big dataset:

DurationAtStart = 
VAR auxT_ =
    ADDCOLUMNS (
        Log,
        "ValueSum_",
            CALCULATE (
                SUM ( Log[duration] ),
                Log[event_number] <= EARLIER ( Log[event_number] ) - 1,
                ALLEXCEPT ( Log, Log[id] )
            )
    )
RETURN
    AVERAGEX ( auxT_, [ValueSum_] )

Do you any tips on how I can change the measure so everything works faster? Right now on a bigger dataset it stops calculating because the memory limit will get reached. I don't want to pre calculate everything unless it really is the last option.

 

Thank you for your help!

Lucmax

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

lbendlin
Super User
Super User

Please provide sample data in usable format (not as a picture).

 

Have you considered using DAX Studio to evaluate the performance of your measure query?

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.