Hello @vvillela,
Thank You for posting your query and we welcome you onto the EDNA Forum.
This is an perfect example of having multiple dates into the data model and how to manage them? Well, don’t worry about that we’ve got you covered here.
Firstly, since you’ve already created an active relationship between the “Start Date” and “Dates” table and Power BI also allows you to create and have only one active relationship at a time between the tables.
But you can create multiple in-active relationships in your data model as per your requirements. And now, using the “USERELATIONSHIP()” function you can activate the in-active relationships individually that has been created between the tables directly into the “Measure” itself.
And the best part is, you have to use this function in your base or primary measures only and then in subsequent measures you don’t have to make use of it again-and-again i.e. “Measure Branching Technique” will take care of it.
For example, let’s say you want to analyze the Sales based on End Dates. But End Dates is having an in-active relationship with the Dates table. So now, inside the measure itself you can activate this in-active relationship using the function. The measure will be like this -
Total Sales as per End Date =
CALCULATE(
SUMX(
Sales ,
Sales[Quantity] * Sales[Unit Price] ) ,
USERELATIONSHIP( Sales[End Date] , Dates[Date] ) )
Now, once this measure is written and furthermore let’s say you want to analyze Sales Last Year based on End Dates then you don’t have to make use of this function again in your measures. The “Base Measure” or “Primary Measure” which we’ve created just above will take care of everything. Now, you just have to create the measure like you would do in normal circumstances. Below is the measure provided for the reference -
Total Sales Last Year as per End Date =
CALCULATE( [Total Sales as per End Date] ,
DATEADD( Dates[Date] , -1 , YEAR ) )
You see that’s how much simple it is!!!
So now, I’m also providing the links of the articles, blog posts or videos pertaining to this very topic so that you can understand this concept in a much more bettter manner.
Hoping you find this useful and helps you to understand the concept as well as meets your requirements that you’ve been looking for.
Thanks and Warm Regards,
Harsh
https://curbal.com/blog/glossary/userelationship-dax