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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
elliottcarver
Frequent Visitor

What's the Best structure for my Relationships between Document Header, Line, Line Category tables?

Hello,

 

I'm wondering if this community can give some guidance on how to structure my relationships and measures.

I have the following tables that I'm trying to report on. The Document Line tables contain data like the [Quantity] fact-numbers I'm interested in reporting on.

 

 

Tables

Project

Document Header

Document Lines

Line Category

Project

Project Document Header Type A

Project Document Line Type A

Project Document Line Category (not a 'Dimension' table, each project can have different line-types)

 

 

Project Document Header Type B

Project Document Line Type B

Project Document Line Category (same table as above, the lines on different project documents are the same for all project documents)

 

Data

See Excel for example data https://stradenergy-my.sharepoint.com/:x:/p/ecarver/EfI4O2o1L15Jlc94FzUDQFwB6BGLd-rveLxBpC6wzoNdLg?e... (is there a way to just upload my Excel file here? I think I've seen that on other posts)

 

Measures

Type A Total Quantity= Sum ('Project Document Line Type A'[Quantity])

Type B Total Quantity= Sum ('Project Document Line Type B'[Quantity])

 

Visualizations

I need to use that measure on these hierarchies:

 

Project

By Project Document Line Category Description

 

Project

By Project Document Type A

By Project Document Type B

 

Project Document Type A

By Project Document Line Category

 

Project Document Type B

By Project Document Line Category

 

So my question is: how do I structure my relationships?

 

Option 1

Does having Project Document Line Category connected to both Line tables create a problem?

 

  • Project
    • Project Document Header Type A
      • Project Document Line Type A
        • Project Document Line Category

 

  • Project
    • Project Document Header Type B
      • Project Document Line Type B
        • Project Document Line Category

 

Option 2

Does having a many-to-many relationship between Project Document Header and Project Document Line Category create a problem?

This seems more logical to but I'm not confident of the implications of many-to-many relationships.

 

  • Project
    • Project Document Header Type A
      • Project Document Line Category
        • Project Document Line Type A

 

  • Project
    • Project Document Header Type B
      • Project Document Line Category
        • Project Document Line Type B
2 REPLIES 2
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @elliottcarver 

 

did you solve your problem?

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


mwegener
Most Valuable Professional
Most Valuable Professional

Hi @elliottcarver ,

 

my recommendation would be as follows.

Create one "Document" fact-table with Power Query.

Take the document line as a base and extend it to the other information (document header, category)

PBIX

 

Relation.png

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Kudoed Authors