Forum Discussion

Pbiuserr's avatar
Pbiuserr
Icon for Post Prodigy rankPost Prodigy
3 years ago

Measure takes long to execute

Hello,
I wonder why this measure is so slow. First I create INTERSECT from ID's from both dim and fact table 

Planned SKU = 
COUNTROWS(INTERSECT (
VALUES (DimTable[ID] ),
VALUES (FactTable[ID] )

and my final measure is 

Planned SKU by date =
CALCULATE (
[Planned SKU],
FILTER (
ALL ( 'date' ),
'date'[Date] <= MAX ( 'date'[Date] )
)
)

 

I have also one filter on that page which only let me take last 5 years into consideration

 

    'Date'[Date] <= EOMONTH ( TODAY (), 0 )
        && YEAR ( 'Date'[Date] )
            >= YEAR ( TODAY () ) - 5,
    1,
    0
)

 

 

 

I try to create area chart made of YearMonth as axis, this measure [Planned SKU by date] and cost center as the legend and it takes forever. Does anybody recognize at which part it can take so long?

 

1 Reply

  • Pbiuserr , Try like, I think simple countrow should also work

     

    Planned SKU by date =
    CALCULATE (
    countrows(filter(Fact, not(isblank(related(DimItem[ID])) )),
    FILTER (
    ALL ( 'date' ),
    'date'[Date] <= MAX ( 'date'[Date] )
    )
    )