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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mamal
Frequent Visitor

Displaying size range for items with no data

Hi,

I am trying to find the best way to present data of product availability as follows:

1. We have a table of available stock in different sizes but not always all sizes are available (in which case there would be no entry for them); this table also contains other columns such as availability date.

ProductSizeAvailable dateQty
AS1.1.20255
AS1.1.202610
AXS1.1.20254
AL1.1.20257
BM1.1.20248
BM1.1.20257
BS1.1.20242
BL1.1.20249
CXS1.1.20258
CM1.1.20244
CL1.1.20259
CL1.1.202610

2. I also have a table lookup with size grid for different products:

ProductSize
AXS
AS
AM
AL
BS
BM
BL
BXL
CXS
CS
CM
CL

 

What I would like to achieve is a table, in which this data is consolidated and the size grids are displayed for each respective product by either highlighting cells within grid or by displaying 0 (but due to the size of the data table, I hope to avoid creating "dummy" rows of data for the missing sizes).

So the end result should look something like this:

mamal_0-1714037400590.png

or

 

mamal_1-1714037409757.png

 

I would appreciate any ideas!

 

1 REPLY 1
johnbasha33
Impactful Individual
Impactful Individual

@mamal 

To achieve the desired result in Power BI, you can follow these steps:

1. Load both tables (available stock and size grid lookup) into Power BI.
2. Create a relationship between the two tables based on the "Product" column.
3. Create a new calculated column in the size grid lookup table to concatenate the "Product" and "Size" columns. This will be used for lookup purposes.
4. Create a new calculated column in the available stock table to calculate the total quantity for each product and size combination. Use a DAX formula like this:

```dax
TotalQty = CALCULATE(SUM('Available Stock'[Qty]), ALLEXCEPT('Available Stock', 'Available Stock'[Product], 'Available Stock'[Size]))
```

5. Use a matrix or table visual in Power BI to display the data. Use the "Product" column from the size grid lookup table as rows and the "Size" column from the size grid lookup table as columns.
6. Use the "TotalQty" calculated column as the values in the matrix or table visual.
7. Format the visual to display 0 instead of blank for missing values. You can do this by going to the "Format" pane, expanding the "Values" section, and selecting "Show items with no data" and choosing "Show items with no data as 0".

This approach will dynamically display the available stock quantities for each product and size combination, without the need for dummy rows for missing sizes. You can customize the visual further to highlight cells or apply conditional formatting as needed.

Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.