Forum Discussion
Earlier function with large dataset
- Anonymous8 years ago
Hi Esmee,
Please remove 'person' filed and try to use below formula:
measure = CALCULATE ( SUM ( Blad1[amount] ); FILTER ( ALL ( Blad1 ); Blad1[date] < MAX ( Blad1[date] ) && Blad1[persoon] IN VALUES ( Blad1[persoon] ) ) ) + 0Regards,
Xiaoxin Sheng
Hi Esmee,
The performance is due to your formula, for calculated column it will calculate through 1+2+3+n(row count) rows. Then your measure will duplicate these operations.(1+ 2+1 + 3+2+1 + 4+3+2+1...) It obviously will cause performance issue.
I haven't find any effective solutions to improve performance, maybe you can try to use below measure if it works.
Measure =
VAR _currentDate =
MAX ( Blad1[date] )
VAR _currentPersion =
SELECTEDVALUE ( Blad1[persoon] )
VAR _currentCampaign =
SELECTEDVALUE ( Blad1[campaignID] )
RETURN
CALCULATE (
SUM ( Blad1[amount] );
FILTER (
ALLSELECTED ( Blad1 );
Blad1[date] < _currentDate
&& Blad1[persoon] = _currentPersion
&& Blad1[campaignID] < _currentCampaign
)
)
Regards,
Xiaoxin Sheng
- Esmee8 years agoFrequent Visitor
Thank you for your suggestion!
I tried to use the measure and adjusted it a bit:
measure = CALCULATE (
SUM ( Blad1[amount] );
FILTER (
ALL(Blad1 );
Blad1[date] < max(Blad1[date])
&& Blad1[persoon]=SELECTEDVALUE(Blad1[persoon])
))
It works but only if I include the persoon in the table:
campaign measure persoon 3 2 a 3 2 b 1 1 b 2 1 a What I would like is to create a table like this:
campaign measure 3 4 1 1 2 1 4 0 But when I remove the persoon the table gives no value.
I hope you can help me!
- Anonymous8 years agoNot applicable
Hi Esmee,
Please remove 'person' filed and try to use below formula:
measure = CALCULATE ( SUM ( Blad1[amount] ); FILTER ( ALL ( Blad1 ); Blad1[date] < MAX ( Blad1[date] ) && Blad1[persoon] IN VALUES ( Blad1[persoon] ) ) ) + 0Regards,
Xiaoxin Sheng
- Esmee8 years agoFrequent Visitor
Thanks! It works!