Forum Discussion
How to handle 2 Datedimensions
- Anonymous1 year ago
Hi showy ,
Thank you m4ni and mh2587 for the insightful responses!Your current method of utilizing two separate date dimension tables one for CreateDate and another for DocumentDate is both valid and recommended when needed slicers to filter visuals based on different dates.
Because slicers work only with active relationships, having distinct date tables ensures visuals are filtered correctly according to the relevant date field.
While the USERELATIONSHIP() function is useful for measures that require calculations using an inactive relationship, it does not impact slicer behavior or filtering at the visual level.
Hope this helps.
Thank you.
hi showy
You can activate the relationships in DAX code using the USERELATIONSHIP function.
For example, if you are evaluating a measure using createddate then that is the active date so you dont need to do anything.
At the same time you can evaluate a measure on document date (without changing the phisical relationships) by using the USERELATIONSHIP function. Both will work at the same time.
Example on document date:
YouMeasureName = CALCULATE(YourMeasure, USERELATIONSHIP(Date'Date, YourFactTable'DocumentDate)
This will enable the relationship in code. HTH
hi m4ni
this post is not about to create a measure or evaluate any values. Its about to controll the visuals.
On the one hand some visuals are based on creation date on the other hand other visuals are controlled by the document date.
The question is how to handle this topic with datetabel(s).