Appreciate all the information, but finding it difficult to really understand everything as these almost too much info. I’m struggling to just understand what scenario you are dealing with to be honest right now.
Your formula is very long… there’s really no way I can really understand it as shown without seeing the model and testing it. But in my honest opinion it’s length and complexity is unnecessary and is likely why you’re finding it difficult to get a solution.
As you know I’m not big on large formulas as prefer the ‘measure branching’ technique where you build things out piece by piece.
Have you tried breaking down your formula and seeing how each part behaves in the current context?
Are you actually trying to show through time what contracts are live? and the revenue (Q) you are making over time?
I’m guessing here but for this you need the events in progress pattern. See below.
This pattern allows you to aggregate totals when dealing with multiple dates, and you don’t need multiple date tables like it looks like you maybe have.
I’m also very confused by this part of the formula, as have never come across or had to use anything like this before
EXCEPT (
SELECTCOLUMNS (
FILTER ( ALL( Contrato ); Data >= Contrato[DiniVig] && Data < Contrato[DfimVig] );
"Contrato"; Contrato[Contrato]
);
SELECTCOLUMNS (
FILTER ( VALUES ( Contrato ); Data >= Contrato[DiniVig] && Data < Contrato[DfimVig]);
"Contrato"; Contrato[Contrato]
)
)
I’m hoping that this is just a managing multiple dates problem that can be solved by the patterns I’ve suggested above.
I did as your sugestion and I believe that I got almost the total result I need.
Just one specific issue remains:
Submarket has a particularity that I have tested and is a cause of error.
And this error, will occur in any other variable that has the same particularity.
When the current scenario changes into the future 2, Contract C changes the submarketing too! (SE to NE)
The way I am using EXCEPT ( the whole tables) is including Contract C in the Current Scenario and Contract C in Future Scenario 2.
Once the Submarkets are different, EXCPT considers these to be Different Contracts. Actually the validity of the contract should consider just the name, scenario and validity ( vigency).
My idea of solution is to consider in Except not the whole table but only the fields:
Contract, Scenario, DiniVig and DfimVig
I Put the files in the DropBox, if you could help.
Can you break it down really simply with images exactly where assistance is required.
Just remember I’m coming at this with really no prior understanding of what scenario this is, and what you are trying to achieve (and it’s in a slightly different language).
If you could try to simplify what you need here exactly, either via a formula or modelling help that would be appreciated.
From my initial look at the model you haven’t completed any of the suggestions I made earlier around using the events in progress pattern…any reason why? This is how you manage multiple dates like you have here.
At first, I did not use the scenario for inactive relationships because I understood that since I should use more than one relationship at the same measure I could not use the Userelationship function and for that reason I was believing that the inactive relationship had no effect .
So, instead, I had kept using the filter without the inactive physical relationships.
Just one more question :
Am I correct to understand that using inactive relationships without the function Userelationship works?
In reality for this specific solution you could actually use no relationship at all and it would still work.
The reason though you have to create these relationships (inactive ones) is because if you do anything else you need to have these and utilise USERELATIONSHIP to turn them on.
If you have active relationship here it will throw everything. So that’s why this is the recommended way to work through this solution