Forum Discussion

Scala's avatar
Scala
Frequent Visitor
3 years ago
Solved

Using aggregate (sum) in visuals is removing rows

Hello everyone! I've run into some behaviour in PowerBI I don't quite understand, which makes it difficult to figure out how to work around it. I have a table that has some master data for materials. Material number is unique in this table. Data looks something like:

 

Material numberName
AB1Product1
CD2Product2
EF3Product3

 

This table has a relation with a stock table.

 

Material numberAmountLocation
AB11A
AB12B
CD23A

 

Relation is 1 to n, with crossfilter direction single. There are no other tables related to either of these two tables.

 

Now I'd like to combine the Material number and Name from the material table, with the sum of the available stock from the stock table. What I'd want is a table visual that contains:

Material numberNameSum amount
AB1Product1   3
CD2Product2   3
EF3Product3

 

 

What seems to be happening is the material numbers with no records in the stock table are no longer shown in the visual:

Material numberNameSum amount
AB1Product1  3
CD2Product2

  3

 

How can I create a table visual that also shows the materials without stock? 

  • Scala , Add +0 in your measure

     

    sum(Table[Amount]) +0

     

     

    or use the option in visual, show item with no data

     

2 Replies

  • Scala , Add +0 in your measure

     

    sum(Table[Amount]) +0

     

     

    or use the option in visual, show item with no data