Forum Discussion

PJStevens's avatar
PJStevens
Icon for Advocate II rankAdvocate II
2 years ago
Solved

Help optimizing a row by row calculated column that filters on the past 30 minutes

Hello All,   I have spent all day today and yesterday trying to solve an issue I have with a calculated column a former colleague made. It is taking extremely long to run over data sets of 300-400k...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi PJStevens ,

     

    Maybe you can try below formula to create calculated column:

    Summed Calculation = 
    VAR CurrentDateTime = 'Table'[DateTimeKey]
    VAR StartTime = CurrentDateTime - TIME(0, 30, 0)
    VAR Summed = 
        CALCULATE(
            SUM('Table'[Counter Onderbreking CV]) / 4,
            FILTER(
                'Table',
                'Table'[DateTimeKey] <= CurrentDateTime &&
                'Table'[DateTimeKey] > StartTime
            )
        )
    RETURN
        IF(Summed = 1, 1, 0)
    

    Best Regards,
    Adamk Kong

     

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