Forum Discussion

AndrewS's avatar
AndrewS
New Member
3 years ago
Solved

Matrix which shows only where CountRows is blank

I am using the following measure to show me how many instances of an Event have taken place each day:

 

EventCount = CALCULATE(COUNTROWS(EventsTable), EventsTable[EventCode] = 5)

 

This produces the below matrix, which is perfect. It shows the Site_ID as well as the individual machines within that site and a count by Date and Day Name. The Date and Day Name are in a separate calendar table, linked to the EventsTable by the Date.

What I would also like, however, is a matrix that only shows the machines where there was no instance of the EventCode occuring on a particular day - in other words, just the three parts I've highlighted in yellow.

 

Is this possible?

I've tried adding "+0" to the end of my measure (in order to then filter the visual to just show where the EventCount = 0) but that just changes everything to zero. Using If(ISBLANK(EventCount), 0, EventCount) does the same.

Plus, if I just filter the visual where the EventCount is blank I get a completely empty matrix.

 

Thanks for your help!

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi AndrewS ,

     

    Please try this measure.

    Measure = IF(NOT [EventCount], 0 )

    Disables the show items with no data for the [Date] axis.

    Please refer to the sample file.

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

    • AndrewS's avatar
      AndrewS
      New Member

      Hi Gao

       

      Thanks for that - it works perfectly!