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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
EugenioProlog
Helper II
Helper II

What is the data structure to create a matrix table?

I want to create a dashboard for inventory control. I need to manage the stock of macro items (kits) and sub-items (components of the kits). I want to create a matrix table where I have the items (kits) in the rows and the stock value, monthly consumption, and replenishment lead time in the columns. In this matrix table, I want to be able to expand the rows (kits) into rows for the sub-items.

 

How would I structure the data on my tables to create this type of matrix table?

 

Thank you.

 

(Example Image of the kind of drill-down I want, please ignore the names)

EugenioProlog_0-1768246309347.png

 

1 ACCEPTED SOLUTION
FBergamaschi
Super User
Super User

Hi @EugenioProlog,

you should have:

one fact table with product id, day (or YearMonth), qty and value 

one calendar table at the day or month granularity, depending on your needs (Primary Key Date or YearMonth)

one product table (PK ProductId, leadtime, other attributes, SubitemId)

one subitem table (PK SubitemId, attributes, KitId))

one kit table (PK KitId and attributes)

 

connect all dimentions to the fact table one to many

 

then you need a DAX measure to implement your logic (measures)

 

For example, the data you are showing refer to February, is that the value at the end of the month?

 

Best

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

Hi @EugenioProlog 

There isn’t a one-size-fits-all answer to this. Even with a very flat dataset, that layout can be achieved as long as the necessary columns exist—similar to how it works in Excel pivot tables. However, from a data modeling perspective, date attributes and product attributes should reside in separate dimension tables and be related to the fact table through a product key/ID and a date ID or date column. When a measure or aggregation is added to a visual alongside columns from these dimension tables, Power BI automatically displays only the rows where records exist for the corresponding combinations of dimension attributes.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
FBergamaschi
Super User
Super User

Hi @EugenioProlog,

you should have:

one fact table with product id, day (or YearMonth), qty and value 

one calendar table at the day or month granularity, depending on your needs (Primary Key Date or YearMonth)

one product table (PK ProductId, leadtime, other attributes, SubitemId)

one subitem table (PK SubitemId, attributes, KitId))

one kit table (PK KitId and attributes)

 

connect all dimentions to the fact table one to many

 

then you need a DAX measure to implement your logic (measures)

 

For example, the data you are showing refer to February, is that the value at the end of the month?

 

Best

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.