Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Count is not correct after after a visual filter

Hi:

I have a table with the next data:

Device name, time when the device was operated, # of operations

I added a table  to count how many times the device recorded  an operation. In this case,

Device2 was operated 6 times and

Device4 was operated 1  time
I added another visual to know the total of devices:  In this case 2 devices: 

(The count depend on the time range indicated by the slicer)

My issue is when I added a filter to the visual table to show only devcies that have been operated more than 1. The Count is not updated. It should  be 1. How can I do to count the devices based in the filter on the visual table? 

 

 

Thank you.

 

 

 

  • Hi, Anonymous ;

    In your screenshot, the fillter condition only apply on one visual. as count of Device , it don't have filter.

    so we could create a measure on another visual to keep sync.

    cout = CALCULATE(DISTINCTCOUNT('Table'[Device]),FILTER('Table', CALCULATE(COUNT('Table'[Device]),ALLEXCEPT('Table','Table'[Device]))>1))

    The final show:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

6 Replies

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

    what is the current code of the measure?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi:

       

      I dont have any measure. 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you ribisht17 , but that measure is not enough. I need to apply a filter to the count as @ v-yalanwu-msft mentioned. 

       

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Icon for Community Support rankCommunity Support

    Hi, Anonymous ;

    In your screenshot, the fillter condition only apply on one visual. as count of Device , it don't have filter.

    so we could create a measure on another visual to keep sync.

    cout = CALCULATE(DISTINCTCOUNT('Table'[Device]),FILTER('Table', CALCULATE(COUNT('Table'[Device]),ALLEXCEPT('Table','Table'[Device]))>1))

    The final show:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you! It is was I needed. It is working perfectly.