Forum Discussion
How to model and aggregate rate (dimension) and amount (fact) per Kimball “header/line item” ?
- Anonymous1 year ago
Hi jaryszek ,
Thanks for the follow up. Understood that you're exploring whether TREATAS is the best fit here and waiting for more optimized DAX inputs.
Just to add some context - TREATAS is commonly used in scenarios involving multiple fact tables at different grains. It helps propagate filters between them without needing physical relationships, which can be beneficial for both performance and flexibility in complex models. This is particularly relevant when dealing with rate-based vs transactional fact tables.
You might find these references useful:
Solved: Best practice for structuring data with Header and... - Microsoft Fabric CommunitySolved: How to create measures across multiple fact tables... - Microsoft Fabric Community
Solved: Re: TREATAS to filter multiple columns in combinat... - Microsoft Fabric Community
Thanks to jaineshp for valuable suggestions.
Hope this helps. Please reach out for further assistance.
Thank you.
Hello jaineshp .
It could be nice but I afraid about having too many shared dim tables in a model. It will be difficult to handle.
What about DAX statement?
Could i handle it as measure?
p.s. I know yur answer from chat gpt. But really is the solution from real life example?
Best,
Jacek
- jaineshp1 year ago
Memorable Member
Hi jaryszek ,
Totally understand your concern, having too many shared dimensions in a model can make it feel heavy and harder to manage, especially if the fact tables keep growing.
DiscountEffectivePrice (Avg) :=
CALCULATE(
AVERAGE('Fct_EA_AmortizedCosts_DiscountPlans'[DiscountEffectivePrice]),
TREATAS(
VALUES('Fct_EA_AmortizedCosts'[OfferId]),
'Fct_EA_AmortizedCosts_DiscountPlans'[OfferId]
),
TREATAS(
VALUES('Fct_EA_AmortizedCosts'[ResourceLocationNormalized]),
'Fct_EA_AmortizedCosts_DiscountPlans'[ResourceLocationNormalized]
),
TREATAS(
VALUES('Fct_EA_AmortizedCosts'[PricingModel]),
'Fct_EA_AmortizedCosts_DiscountPlans'[PricingModel]
)
)
Hope this helps!
Best Regards,
Jainesh Poojara | Power BI Developer- jaryszek1 year ago
Super User
Thanks.
I do not know if Treatas is the best option here. Also chat gpt advised this to me.
Let's wait for more optimized daxes.
Best,
Jacek- Anonymous1 year agoNot applicable
Hi jaryszek ,
Thanks for the follow up. Understood that you're exploring whether TREATAS is the best fit here and waiting for more optimized DAX inputs.
Just to add some context - TREATAS is commonly used in scenarios involving multiple fact tables at different grains. It helps propagate filters between them without needing physical relationships, which can be beneficial for both performance and flexibility in complex models. This is particularly relevant when dealing with rate-based vs transactional fact tables.
You might find these references useful:
Solved: Best practice for structuring data with Header and... - Microsoft Fabric CommunitySolved: How to create measures across multiple fact tables... - Microsoft Fabric Community
Solved: Re: TREATAS to filter multiple columns in combinat... - Microsoft Fabric Community
Thanks to jaineshp for valuable suggestions.
Hope this helps. Please reach out for further assistance.
Thank you.