Forum Discussion
Esmee
8 years agoFrequent Visitor
Earlier function with large dataset
Hi! I have a large dataset about 3M records which looks like this: campaignID persoon date amount number 1 a 3-6-2016 1 0 1 b 3-6-2016 1 1 1 c 3-6-2016 1 0 2 ...
- 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
Esmee
8 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!
Anonymous
8 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] )
)
)
+ 0
Regards,
Xiaoxin Sheng
- Esmee8 years agoFrequent Visitor
Thanks! It works!