Forum Discussion
enoch99
Helper I
3 years agoDistinct Count by comparing two summarized tables
Hi everyone, I am new to DAX and need your support in solving this problem. I have two Excel files. One contains yearly target planned for different activities while the second contains mont...
- 3 years ago
enoch99 You can create a calculated column in Target table
Reached = SUMX ( FILTER ( Reached, [Activity] = EARLIEST ( Target[Activity] ) ), [Reached] )If you need a measure, then try the below measure
Lagging = VAR _target = ADDCOLUMNS ( Target, "@Reached", SUMX ( FILTER ( Reached, [Activity] = EARLIER ( Target[Activity] ) ), [Reached] ) ) VAR _result = COUNTX ( FILTER ( _target, [@Reached] < [Target] ), [Activity] ) RETURN _result
nandukrishnavs
Community Champion
3 years agoenoch99 based on above dataset, what is the expected result. Can you mention that as well?
- enoch993 years ago
Helper I
nandukrishnavsI want a table like this:
I think I can compare the Target and Reached columns after that to count the number of activities lagging behind.
Thanks
- nandukrishnavs3 years ago
Community Champion
enoch99 You can create a calculated column in Target table
Reached = SUMX ( FILTER ( Reached, [Activity] = EARLIEST ( Target[Activity] ) ), [Reached] )If you need a measure, then try the below measure
Lagging = VAR _target = ADDCOLUMNS ( Target, "@Reached", SUMX ( FILTER ( Reached, [Activity] = EARLIER ( Target[Activity] ) ), [Reached] ) ) VAR _result = COUNTX ( FILTER ( _target, [@Reached] < [Target] ), [Activity] ) RETURN _result- enoch993 years ago
Helper I
nandukrishnavs Thank you for your quick response. This is what I was looking for.