Forum Discussion
Trying to get the difference between two measure values using DAX
- 4 years ago
Thanks so much. I have found the solution. I will post it here soon, hopefully
Hi:
If yu use dropbox or google drive you can upload to those site and grab a link and paste it into your message.
If you want you can send to my email [email protected]
Thanks.
Thanks so much. I have found the solution. I will post it here soon, hopefully
- charlie74914 years ago
Microsoft Employee
The solution is to use the User Relationships approach.
1. You have to put the StartDate and EndDate fields into two separate tables (for example DimDate and DimEndDate, respectively).
2. Make both of these tables have a relationship with the main table that have the values you are looking to filter based on the StartDate and EndDate slicers
In our example, that table and field to be filtered is AADPTable[AADPMAU_Sum]
3. Since you can only have one active relationship at a time, you make the relationship between the DimDate and AADPTable the active one, with a relationship based on the FactDate field
AND you make the relationship between the DimEndDate and AADPTable the INACTIVE one, also with a relationship based on the FactDate field
4. Having set things up as described above,
The AADPMAU_Sum value associated with the StartDate slicer would be as follows:AADPMAU_Start = sum(AADPTable[AADP MAU])
The AADPMAU_Sum value associated with the EndDate slicer would be as follows:AADPMAU_End =CALCULATE(AADPTable[AADPMAU_Sum],ALL(DimDate),USERELATIONSHIP(DimEndDate[EndDate],AADPTable[FactDate]))
This article explains User Relationships Using USERELATIONSHIP in DAX - SQLBI