March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi community,
In almost all of my projects I came across databases, that contains separate tables for headers and details / lines e.g. Order_Heads contains OrderID, CustomerID and OrderDate, while Order_Lines contains the details of each order like OrderID, Order_line_ID, product_ID, quantity. That’s a very common scenario and I deal with them in different ways, depending on the business case, the KPIs and the associated dim_tables.
On way of course is to model them as separate tables and build a relationship on the OrderID. In complex models, that often becomes a challenge, where I have to go into bi-directional relationships, which I don’t feel are optimal.
The second way is to merge them together (e.g. via Power Query) to get one big order table, containing the order information on the line granularity. That eases the data model but comes with the downside, that certain DAX becomes a bit complex and slow as well.
A third way – I call it hybrid – is to aggregate the order line table on certain figures like sum of sales, order quantity, no of products, last order date ect. and then merge that to the order header table. That works like option one plus getting more information into the header table but unfortunately loosing a lot of detail information for instance about the products, which are on the order line level.
I studied Bhavik Merchants book “Performance Best Practices” but unfortunately, he is not mentioning this scenario, even its very common in the real business world.
So I am wondering, is there a recommended or optimal way to handle that challenge. How do you do that in your projects?
I am glad to hear from you and discuss further.
@datadonuts , My Take
Ideally merged table should be able to solve the purpose. For header-level data we can use measure like
Sum of header discount = Sumx(Summarize(Combined, Combined[Order Header id], [Header Discount Value]) ,[Header Discount Value] )
But some time model is more complex and you need the header as a dimension, in that case, you need both merged and header as a dimension. Especially when need to ignore the selected filter on header
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
86 | |
76 | |
57 | |
52 |
User | Count |
---|---|
201 | |
137 | |
108 | |
73 | |
68 |