Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ethanlsaul
Helper I
Helper I

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):

 

ethanlsaul_1-1652994490731.png

 

 

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 

 

ethanlsaul_2-1652994535358.png

 

1 ACCEPTED SOLUTION

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])

View solution in original post

7 REPLIES 7
ethanlsaul
Helper I
Helper I

hey @lbendlin  -- following up to see if i need to provide you with anything else. 

see attached.

 

You can further optimize the calculated column like so:

 

Inventory = 0+CALCULATE(sum('Table'[Inventory]),TREATAS({([Plant],[Product])},'Table'[Plant],'Table'[Product]))

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.

 

ethanlsaul_0-1653501064308.png

 

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])

IT WORKED!!! Thank you so much. 

ethanlsaul
Helper I
Helper I

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
Super User
Super User

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

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.