Forum Discussion
Trying to get the difference between two measure values using DAX
I will like to get the difference between two measure values using DAX
AADPMAU_Increase = [AADPMAU_End] - [AADPMAU_Start]
But when I do the subtraction, I am getting 0
I have tried different things, but nothing is working
The two values are start and end values that are set by date selector filters. It appears that the calculation is always treating both as equal therefore returning 0
AADPMAU_Start = CALCULATE(AADPTable[AADPMAU_Sum],FILTER(DimDate,DimDate[StartDate] = DimDate[StartDate]))
AADPMAU_End = CALCULATE(AADPTable[AADPMAU_Sum],FILTER(DimDate,DimDate[EndDate] = DimDate[EndDate]))
AADPMAU Increase =
var at_end = AADPTable[AADPMAU_End]
var at_start = AADPTable[AADPMAU_Start]
return at_end - at_start
Thanks so much. I have found the solution. I will post it here soon, hopefully
7 Replies
- Whitewater100
Solution Sage
Hi:
You can try the following. Assuming your date slicer is from date table.
startdate = FIRSTDATE(Dates[Date])Enddate = LASTDATE(Dates[Date])Days Diff = INT([Enddate] - [startdate])You may need to adjust the table names to match, but this is the jist of it. Hope this helps.- charlie7491
Microsoft Employee
I need the AADPMAU Increase in the values associated with the date changes (and not the difference in dates)
Do you have any suggestion how I can use your approach to calculate the difference?- Whitewater100
Solution Sage
Hi:
I can check it out but ask for some data , like you are working with.
Even if it's excel with made up info it's fine.
Thanks..