Forum Discussion

Vijay08V's avatar
Vijay08V
Helper III
3 years ago
Solved

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...
  • v-jingzhang's avatar
    v-jingzhang
    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.