Forum Discussion

PatrickF2002's avatar
PatrickF2002
Regular Visitor
3 years ago

Adding 0's to power BI Data

So essentially, I have a set of data for a store that includes cash registers 1-15, with the numerical amount of transactions that occur at these registers for each hour they are operational. My problem is that when there is 0 transactions for a given register in a given hour, instead of showing 0 for that register in that hour, nothing appears. I need to find a way to make those 0's appear for the given register # when no transactions occur.

10 Replies

  • Assuming the numerical amount of transactions is a Count function, create a measure: 

    TransactionsCount = 
    
    var tcount = COUNT(Table[TransactionID])
    
    RETURN
    
    IF(ISBLANK(tcount), 0, tcount)
    • PatrickF2002's avatar
      PatrickF2002
      Regular Visitor

      Im going to include an example image from data view to help explain my issue a little better

      registers 2-8 have txn’s in the txn column

      -registers 1 and 9 do not have txn’s in the txn column, and so they are not showing up in the data set at hour 13.

      -registers 1 and 9 should be included in the data set at hour 13, with the number 0 in the txns column for both respectively

      • ray_aramburo's avatar
        ray_aramburo
        Icon for Super User rankSuper User

        So, do you want to add register 1 and 9 as rows into your source table?

  • Hello PatrickF2002 at the end of your measure write +0 to get the values as '0' whereever the data is not available. 

     

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