Forum Discussion
Pbiuserr
Post Prodigy
3 years agoMeasure 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
- amitchandak
Super User
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] )
)
)