Forum Discussion
Count Distinct Values Over Time & slice
- 8 years ago
This is now solved - through lots of trial and error i managed to get there using allselected() and then adding my dimentions tables as filters in the calculate.
Hi v-yulgu-msft thanks for helping,
Appologies if it wasnt clear - I had commented out the dax in the measure (in the code example) for the one that returns the right result but is not sliceable. Here it is, uncommented so you can see what i am trying to do:
m_CountDistinctIMO_OverTime = CALCULATE( [m_Count_IMONumber], //ERROR - using ALL() on the main fact table means slicers dont work on it. //notes: vessels in transit durin CURRENT month and dispatched //notes: load <=end of current month AND dispatch >=start of current month FILTER( all(Shipments), Shipments[LoadDate] < max(DateTable[lastDayOfMonth])+1 && Shipments[DischargeDate] >= min(DateTable[firstDayOfMonth]) )
)
I have amended the measure in the demo file too so you can see it not slicing. I have just tried using Allselected() as you suggested and although it makes the visuals slica-able again, the incorrect result is returned. As a guide - the correct result for June 2017 is 2691.
Here's the new version fo the demo file: https://drive.google.com/file/d/1bPUXMFMsNBRUhXmyU6pNvWzv1oMH7u6p/view?usp=sharing
If there is anything else i can do to better illustrae the problem to enable you to assist then please just say and ill do all i can.
many thanks again for your help
Mat
Anyone got any ideas on this one? It's driving me up the wall!
appreciate any ideas or *prods* in the right direction
Cheers
Mat
- MatWebb8 years agoAdvocate I
This is now solved - through lots of trial and error i managed to get there using allselected() and then adding my dimentions tables as filters in the calculate.