Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Total discrepancy when using a countrows filter measure in a card visual

Hello

 

I've checked some posts and watched some videos but cannot find a solution yet.

 

I am trying to count the number of rows in a table which have certain criteria but the total showing in the card does not match the actual total when I check this in Excel, so please could someone explain what I need to do to resolve this ?

 

The table has a column called daysOldInInterval containing a numeric value representing how many days it took to complete a task.

 

 

The measure needs to count the number of rows matching certain criteria ie how many tasks took between 2 and 5 days.

 

Ttl 1w = CALCULATE(COUNTROWS(filter('All Tasks','All Tasks'[daysOldInInterval] >=2 && 'All Tasks'[daysOldInInterval] <=5)))
 
When I put this into a card it shows 234 but the correct count in Excel is 277...
 
Many thanks in advance
 

 

 

 

 

  • It could be some underlying relation of filters that is effecting the measure. If your data is not sensitive, can you share the pbix file. I won't be able to scope out where the problem lies without seeing the data and the report.

5 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you, I didn't know that.

  • Hello Andy,

    First issues I see there is how your query is filtering out the data. Can you update your query with the below one.
    Here is the revised query.

     

    Ttl 1w = 
    CALCULATE(
        COUNTROWS('All Tasks'),
        FILTER(
            'All Tasks',
            'All Tasks'[daysOldInInterval] >= 2 && 'All Tasks'[daysOldInInterval] <= 5
        )
    )

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks, I just updated the measure but the card total is still the same...is something else wrong ?

      • DatawithDinesh's avatar
        DatawithDinesh
        Resolver II

        It could be some underlying relation of filters that is effecting the measure. If your data is not sensitive, can you share the pbix file. I won't be able to scope out where the problem lies without seeing the data and the report.