Forum Discussion

Sharu's avatar
Sharu
Frequent Visitor
7 years ago
Solved

Measure not filtering as expected

Dear all,

 

I need to calculate the amount of repeated incidents per category and the incidents need to have a standard solution. I used the following formula to calculate it (I have blanked out the table names):

 
See the picture below for the visual. Sidenote: I have added a visual filter KPI04.1 occurence > 1, because then the visual will only show the actual amount of incidents which have happened more than once.
 
When I did some testing, I came to the conclusion that my filter only worked partly. It does filter out some of the reocurring incidents which don't have standard solution, but somehow not all of them. Only when I add another visual filter (standard solution = yes), it shows my desired outcome. Does anyone know what is wrong with my formula? And is this the right/best way to calculate how many repeated incidents there are? I don't have much experience with DAX, so any help would be helpful!
 
Thanks in advance!
 
Sharu
  • Sharu's avatar
    Sharu
    7 years ago

    Thanks for your help! I altered your measure a little bit, and it works!

     

    This is the measure I ended up using:

     

    KPI = CALCULATE(( COUNT(Table[Brief Description (Details)])), FILTER(Table,[Standard solution] = "Yes" ) )

4 Replies

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

    Sharu ,

     

    This issue may caused by one filter is affected by other filters in other visuals. To be general, you may modify measure like pattern below and check if the issue persists.

    KPI =
    COUNTROWS (
        FILTER (
            ALL ( Table ),
            [Brief Description (Details)] = EARLIER ( [Brief Description (Details)] )
                && [Standard solution] = "Yes"
        )
    )
    

    Community Support Team _ Jimmy Tao

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Sharu's avatar
      Sharu
      Frequent Visitor

      v-yuta-msft 

       

      Thanks for your reply! I created a new blank Power BI file and created this visual again while using your measure, but unfortunately I got the same result as before. Is there any other way to calculate the amount of repeating values?

       

      Sharu

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

        Sharu ,

         

        How about measure below?

        KPI =
        CALCULATE (
        COUNT ( Table[Brief Description (Details)] ),
        FILTER (
        ALLEXCEPT ( Table, Table[Brief Description (Details)] ),
        Table[Standard solution] = "Yes"
        )
        )

         

        Community Support Team _ Jimmy Tao

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.