Forum Discussion
Show Purchased/Returned Date using Calendar Table
- Anonymous4 years ago
Hi Anonymous
You cannot filter the two fields of the data table directly through the calendar date table, because there can only be one active relationship between the two tables. If you want to filter two dates at the same time, you need to create an active relationship and an inactive relationship between the two tables, and then use USERELATIONSHIP() to activate the inactive relationship. One thing to note, when you add the measure that creates the activation relationship to the corresponding visual, it will take effect
(1)Create two relationships between data table and calendar date table .
(2)Then create a measure to activate the inactive relationship.
Quantity by returned date = CALCULATE(SUM(Items[Quantity]),USERELATIONSHIP(Items[Date Returned],'Calendar'[Date]))(3) If you put two dates in the same chart, it may seem a bit messy, you can separate the purchase date and the return date into two charts.
I have attached my pbix file, you can refer to it .
Best Regard
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
You cannot filter the two fields of the data table directly through the calendar date table, because there can only be one active relationship between the two tables. If you want to filter two dates at the same time, you need to create an active relationship and an inactive relationship between the two tables, and then use USERELATIONSHIP() to activate the inactive relationship. One thing to note, when you add the measure that creates the activation relationship to the corresponding visual, it will take effect
(1)Create two relationships between data table and calendar date table .
(2)Then create a measure to activate the inactive relationship.
Quantity by returned date = CALCULATE(SUM(Items[Quantity]),USERELATIONSHIP(Items[Date Returned],'Calendar'[Date]))
(3) If you put two dates in the same chart, it may seem a bit messy, you can separate the purchase date and the return date into two charts.
I have attached my pbix file, you can refer to it .
Best Regard
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous4 years agoNot applicable
Thank you, Anonymous for sharing your dashboard to better explain the implementation using USERRELATIONSHIP(...).