Hi there
I have a model which works but can be very slow. I can’t seem to get my head around how to avoid bidirectional relationships.
I have created a simplified version below
I have a number of students. Each student has been at the school for many years at many levels
I want to be able to filter by year and year level in determining the average grade.
This works with the bidirectional filter as shown - But every day I watch a video that says “bidirectional is bad”
Should I just add Treatas to each relevant measure?
e.g.
Average Score = CALCULATE(AVERAGE(Grades[Score]),TREATAS(values(‘Year Level’[ID]),Students[ID]))
Can anyone suggest the best practice approach to dealing with this - either by model or Dax
Cheers
Mark
.
An alternative could also be denormalizing your model, bringing Year Level and Students together in a single table but I guess that will depend on the cardinality and number of attributes that involves…
Thank you Melissa
This clearly works - I feel like I have lots of questions about the consequences of this and say using treatas instead or just leaving in the bidirectional. I will go away and rebuild my model with this and see if it improves the speed of the measures.
Thank you for your help
Mark