Forum Discussion
grggmrtn
5 years agoPost Patron
Distinct CountX?
I have the following DAX measure: CurrentBorger =
CALCULATE (
COUNTX (
FILTER (
'nexus2 Fact_VisiteretTid',
'nexus2 Fact_VisiteretTid'[Start] <= MAX ( Dato[Dato...
- 5 years ago
Ok I actually got it figured out, and it was a LOT easier than I thought it should have been ๐
First, I got rid of the relations between the tables.
Then it was just a matter of creating the following measure:
Measure = VAR StartDato = MIN ( Dato[Dato] ) VAR SlutDato = MAX ( Dato[Dato] ) RETURN CALCULATE ( DISTINCTCOUNT('nexus2 Fact_VisiteretTid'[CPRnrKort]), FILTER ( 'nexus2 Fact_VisiteretTid', ( 'nexus2 Fact_VisiteretTid'[Start] <= SlutDato && 'nexus2 Fact_VisiteretTid'[Stop] >= StartDato ) ) )Seriously, it solved all my problems, and the result validates. Go figure XD
grggmrtn
5 years agoPost Patron
Ok I actually got it figured out, and it was a LOT easier than I thought it should have been ๐
First, I got rid of the relations between the tables.
Then it was just a matter of creating the following measure:
Measure =
VAR StartDato =
MIN ( Dato[Dato] )
VAR SlutDato =
MAX ( Dato[Dato] )
RETURN
CALCULATE (
DISTINCTCOUNT('nexus2 Fact_VisiteretTid'[CPRnrKort]),
FILTER ( 'nexus2 Fact_VisiteretTid', ( 'nexus2 Fact_VisiteretTid'[Start] <= SlutDato && 'nexus2 Fact_VisiteretTid'[Stop] >= StartDato ) )
)
Seriously, it solved all my problems, and the result validates. Go figure XD