Forum Discussion
Multiple dates issue in single graph
- 3 years ago
I found the solution as make all relations with Calender table inactive. Wherever necessary, construct active relations using the DAX formula USERELATIONSHIP.
Let me ask my question another way:
Two slicers is there, and I want to update my bar chart based on the slicers' selection. (Items vs No of item sale in selected time)
2020 is selected as the slicer year.
There are two options in the second slice: 1. "selling and purchasing" 2. "selling only"
If the user selects "Selling only", all items that are selling in 2020 should be displayed. But here, due to the relationship table, it only displays those items that are purchased in 2020 and sold in 2020. I want to remove the active relation of the purchase date if selling is selected on slicer.
I tried following dax, but it is not giving the required output.
Var slicer2 = SELECTEDVALUE(Master[Status])
Var Items= IF(slicer2="Selling only",CALCULATETABLE(DISTINCT(Master[Items]),ALL(Master[Purchase_date]),USERELATIONSHIP('Date'[Date],Master[Selling_Date])),CALCULATETABLE(DISTINCT(Master[Items])))
return Items
Here Two dates are there in master file :
purchase date : In Active relation with calender table and
selling date : In Inactive relation with calender table.
I found the solution as make all relations with Calender table inactive. Wherever necessary, construct active relations using the DAX formula USERELATIONSHIP.