Forum Discussion
TimoKytta
4 years agoRegular Visitor
Counting distinct values within a table
Hello y'all I'm trying to build a calculation to get the following result. I've earlier managed to to some similar with instructions found here, but for some reason I don't get this work right. ...
- 4 years ago
TimoKytta , try a new column like
REFcount =
CALCULATE (
DISTINCTCOUNT ( DailyCapa2[WORKCENTER] ),
FILTER ( DailyCapa2, [REFID] = earlier([REFID])))
amitchandak
4 years agoSuper User
TimoKytta , try a new column like
REFcount =
CALCULATE (
DISTINCTCOUNT ( DailyCapa2[WORKCENTER] ),
FILTER ( DailyCapa2, [REFID] = earlier([REFID])))
TimoKytta
4 years agoRegular Visitor
Thanks for your quick help! 🙏🏻
I actually had that EARLIER() in other similar filter condition, but didn't realize it works in this case too. I read again the description of that function and started to understand a bit of it's logic. So it gives the current value instead of 'previous value' as I have thought before.
Thanks for this!