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])))
smpa01
4 years agoCommunity Champion
TimoKytta you can write a measure like this
Measure = CALCULATE(DISTINCTCOUNT('tbl'[Workcenter]),ALLEXCEPT('tbl','tbl'[Refid]))
- TimoKytta4 years agoRegular Visitor
Thanks to you too!
I chose to use this filtering style since my table has a bit over 730 000 rows and that earlier-function had a mention about possible performance issues with big tables.
Why this your solution works is a bit bigger mystery to me still! ^_^
Does it do so that that the column mentioned in ALLEXCEPT-function is taken as a current rows value for each row? The function documentation says that it's: 'The column for which context filters must be preserved.'