Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

No data presented where no rows exist

We are looking to have a PBI where it shows every day in the row (1-31) with categories as columns (cat1, cat2, cat3 etc) then a count of every item and if no sales were made then show 0. (see current/desired outcomes in table 3 and 4)

 

The issue we are having is that if we sell no items on a day or a category in that month then it will not show the column/row. (see table 2)

 

The data we are using is a line for each item which holds the category name and date/time of sale, therefore, if nothing is sold on the 3rd, then there is no data to show. (see table 1)

 

Table 1 - Data

DateDayItemCategory
01/11/2019111
02/11/2019223
05/11/2019531
05/11/2019541
05/11/2019551

 

Table 2 - Visualization

RowsDay
ColumnsCategory
ValuesCount of Items

 

Table 3 - Current Outcome (Matrix)

DayCat1Cat3
11 
2 1
58 
7 3

 

Table 4 - Desired Outcome (Matrix)

DayCat1Cat2Cat3
1100
2001
3000
4000
5800
6000
7003
  • Hi Anonymous,

     

    If you don't have a Category table create one and relate it, then show the new category field on the columns of the matrix and then build a count measure like this one:

     

     

    Item count = COUNT('Table'[Item])+0

     

    Note the +0 at the end, which makes Power BI show zeros where there is no data.
     
    Let me know if this works for you.

2 Replies

  • pforrer7's avatar
    pforrer7
    Frequent Visitor

    Hi Anonymous,

     

    If you don't have a Category table create one and relate it, then show the new category field on the columns of the matrix and then build a count measure like this one:

     

     

    Item count = COUNT('Table'[Item])+0

     

    Note the +0 at the end, which makes Power BI show zeros where there is no data.
     
    Let me know if this works for you.