Forum Discussion

nic_k's avatar
nic_k
Frequent Visitor
2 years ago

help with optimizing DAX as visual exceeded available resources

Running into an issue where "Visual exceeded available resources" if i don't filter the data for viewing.

All data is within a single table.

 

This how the table looks like when filtered by Name

 

Here is the DAX:

 

Duration From Previous Task = 
VAR _CurrentTaskTime =
    CALCULATE ( SELECTEDVALUE ( 'task'[Created On] ) )
VAR _PreviousTaskTime =
    CALCULATE (
        MAX (  'task'[Created On]  ),
        ALLEXCEPT ( 'task', 'task'[lead.fullname] ),
         'task'[Created On]  < _CurrentTaskTime
    )
VAR _timeDifference =
    IF (
        ISBLANK ( _PreviousTaskTime ),
        0,
        DATEDIFF ( _PreviousTaskTime, _CurrentTaskTime,DAY )
    )
RETURN
    _timeDifference