Forum Discussion
Incorrect Count DAX Function -- Need help
- 3 years ago
Hi Vijay08V
Sorry for the late reply. The solution is to add a 'Years' table to the model to have all year values from the sample table and create a one-to-many relationship from 'Years' table to Sample table on Year column.
Then use 'Years' table's Year column in SELECTEDVALUE function in the measure and in the Year slicer too.
VOLUME COUNT = CALCULATE(COUNT('Sample'[Number]),'Sample'[YEAR]=SELECTEDVALUE('Years'[YEAR],YEAR(TODAY())))Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
VOLUME COUNT = CALCULATE(COUNT(TBL_Sample[Number]),FILTER(TBL_Sample,TBL_Sample[YEAR]=SELECTEDVALUE(TBL_Sample[YEAR],YEAR(TODAY()))))
or try
VOLUME COUNT = CALCULATE(COUNT(TBL_Sample[Number]),ALL(TBL_Sample),TBL_Sample[YEAR]=SELECTEDVALUE(TBL_Sample[YEAR],YEAR(TODAY())))
- Vijay08V3 years agoHelper III
Tried the first dax but still same issue and second one gave a totally different number