Forum Discussion
Combining measures with diffent calendars
- Anonymous7 years ago
Hi Robbe,
I came also across this solution https://carldesouza.com/power-bi-dax-userelationship-multiple-dates/ Is this what you mean?
So creating new measures using a non active relationship?
So the first step would be to just create one date dimension table and relate it to all 3 columns. Set whichever one you would use by default most often as the 'active' relationship, the other two will be inactive.
Then in your measures, you can use USERELATIONSHIP to switch the active relationship in a measure. For example, if you defaulted to Print Date, but wanted to sum groups based on the Close Date, you could write an expression like this one. You can read more about it here.
SumClosed = CALCULATE( SUM(Table1[SummableValue]), USERELATIONSHIP( Table1[CloseDate], Calendar[DateKey]))
There's also the option of using TREATAS instead, which can be useful for more complicated relationships. Further reading can be found here.