Forum Discussion
To connect date with different datekey from same table
- 10 months ago
Hi conniedevina yes it is possible to connect different data columns for certain calculation using DAX USERELATIONSHIP functions
Results:
Model Relationships:
DateTable[Date] = CategoryA_Date (Active)
DateTable[Date] = CategoryB_Date (In-Active)
Dax:
CategoryA = CALCULATE ( SELECTEDVALUE ( fact_table[category_a] ) ) CategoryB = CALCULATE ( SELECTEDVALUE ( fact_table[category_b] ), USERELATIONSHIP ( fact_table[categoryB_date], DateTable[Date] ) )Small Correction: Your Date table date format are not same as Fact table (CategoryA_Date, CategoryB_Date)
Here is corrected date for fact table
Find this helpful? ✔ Give a Kudo • Mark as Solution – help others too!
- 10 months ago
Hi conniedevina
You can create only one active relationship between two tables (if that doesn't result to an ambiguous relationship path with other tables) but you can have more inactive relationships. Inactive relationships can be invoked via measure using USERELATIONSHIP function
The image below shows a single date column but returns different values depending on which inactive relationship is invoked.
Please see the attached pbix.
Hi conniedevina
You can create only one active relationship between two tables (if that doesn't result to an ambiguous relationship path with other tables) but you can have more inactive relationships. Inactive relationships can be invoked via measure using USERELATIONSHIP function
The image below shows a single date column but returns different values depending on which inactive relationship is invoked.
Please see the attached pbix.