Forum Discussion
Vijay08V
3 years agoHelper III
Incorrect Count DAX Function -- Need help
Hi, I have used a simple dax measure to count the number of incidents but whenever I use selectedvalue function in the measure I get incorrect numbers in the chart however correct numbers reflect...
- 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.
jaweher899
3 years agoImpactful Individual
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())))