Forum Discussion

ethanlsaul's avatar
ethanlsaul
Icon for Helper I rankHelper I
4 years ago
Solved

Missing Data in inputs resulting in blanks on Matrix

Hello,

 

For certain warehouses, data does not exist. It isn't 0-- it is non-existent. Thus, changing values from null to 0 doesn't work since it really isn't null- it doesn't exist. As a result, i have a matrix that looks like this....(missing spaces):

 

 

 

I want there to be 0's if it does not exist. I have tried several measures and cant get it to work! 

 

Here's what i want it to look like 

 

 

  • lbendlin's avatar
    lbendlin
    4 years ago

    Should have mentioned that this is a calculated column.  If you must use a measure, add some calculation like MAX() or SELECTEDVALUE().  If you need the totals to work then you need to use an aggregation function like SUMX()

     

    Measure = 
    var a = SUMMARIZE('Table 2','Table 2'[Plant],'Table 2'[Product],"sm",
     CALCULATE(sum('Table'[Inventory]),TREATAS({([Plant],[Product])},'Table'[Plant],'Table'[Product])))
    return 0+sumx(a,[sm])

7 Replies

  • Whitespace reporting (reporting on things that aren't there) requires the use of disconnected tables, crossjoins and special measures.  

     

    Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.

    Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

    https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

     

     

  • Hi There,

     

    It is really a two fold problem-- but i think if i fix this first fold first, it should be easier to fix the missing zeros.

     

    Take a look at the table below and let me know if that makes sense. the stpes are in the top of each table. 

     

     

    Step 1 

    Raw Data Structure
    ProductPlantInventory
    Car 1US132
    Car 2US132
    Car 6US134
    Car 7US133
    Car 3US167
    Car 4US163
    Car 5US165
    Car 6US167
    Car 8US191
    Car 3US1910
    Car 9US192
    Car 7US191

     

    Step 2 

     

    Making Plant rows into columns
    ProductUS13US16US19
    Car 12  
    Car 22  
    Car 3 710
    Car 4 3 
    Car 5 5 
    Car 647 
    Car 7  1
    Car 8  1
    Car 9  

    2

     

    Step 3:

    Make columns blanks = 0
    ProductUS13US16US19
    Car 1200
    Car 2200
    Car 30710
    Car 4030
    Car 5050
    Car 6470
    Car 7001
    Car 8001
    Car 9002

     

     

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

      see attached.

       

      You can further optimize the calculated column like so:

       

      Inventory = 0+CALCULATE(sum('Table'[Inventory]),TREATAS({([Plant],[Product])},'Table'[Plant],'Table'[Product]))
      • ethanlsaul's avatar
        ethanlsaul
        Icon for Helper I rankHelper I

        i am stuck here. It is odd that your file accepted 'plant' and 'product' but when i do it, it doesn't seem to like it. it seems like it almost only accepts measures and since plant and product aren't measures, it rejects.