Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Weird filter behavior

Hi guys, 

I am encountering a weird problem:
People work on certain "Incidents". I want to count how many incidents don't and do have booked hours.

The code I used is:


Count of I hours booked =
CALCULATE(COUNT(
Incidents[Incident ID*+]); FILTER(Hours; Hours[Number Of Hours] <> BLANK() ))


However, as you can see, only 19 incidents are reported as having no hours, whilst all these ID's do have hours.

What's wrong?

3 Replies

  • Hey,

     

    without further knowledge about your data model especially the relationship between the tables 'Hours' and 'Incidents' it's difficult to provide any guidance.

     

    I'm wondering about the large amount of "Number of Hours" without any Incident, maybe this indicated that the relationship between both tables does not find matching values. This can also explain the unexpected result of the measure. By the way, I'm not sure if the screenshot is showing the measure you have been created. The screenshot is showing "No hours booked" and the DAX snippet seems to create a measure called "Count of I hours booked".

     

    Maybe you want to consider to create a pbix file that contains sample data but still represents your data model, upload the pbix file to onedrrive or dropbox and share the link. If you are using an Excel file to create your sample data, please upload this Excel file as well.

     

    Regards,

    Tom

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Tom,

       

      Thank you for the quick reply.

      My bad, in the post I changed the name of the measure, but it is indeed the same (correct) one.
      There are probably lots of incidents that do not have matching values, since not every hour that is booked is on an incident (other tables have other activities on which people book hours).

      Please find below the relationship.

      If you still need more info, I could send you a pbix file.

      Thanks for the help!


      • TomMartens's avatar
        TomMartens
        Super User

        Hey,

         

        please upload the pbix file to onedrive or dropbox and share the link.

         

        Thanks,

        Tom