0
votes

So I have a measure that has the following DAX

PriorDayValue = 
CALCULATE(
    sum(valuetable[CurrentDayValue]),
    PREVIOUSDAY('Date Table'[Date])
)

for some reason my total row is showing either the minimum or first value instead of a sum.

All I'm trying to do is pull the CurrentDayValue for the prior day so I can create another field that calculates the change between that day and the prior day.

I'm not sure if these facts will change anything but The CurrentDayValue field is original data it isn't a Calculated Column or Measure.
Also, the values in the image are the result of multiple filters and I hope the filters I apply to the visual will also apply to the total amount
and lastly the DateTable mentioned in the DAX above has not been Marked as a Date Table but it is does have unique and continuous date values

Any help would be greatly appreciated. I'm new to power bi and I can't help but feel the fix for this is staring me in the face.

EDIT Apparently I'm too new to be allowed to paste photos so here is what the current table visualization looks like

Year--Quarter--Month--Day --CurrentDayValue--PriorDayValue
2019--Qtr 1 --March-- 1 -- 213 -- 209
2019--Qtr 1 --March-- 1 -- 213 -- 213
2019--Qtr 1 --March-- 1 -- 213 -- 213
2019--Qtr 1 --March-- 1 -- 218 -- 213

Total 857 -- 209

1
Can you show some sample data and your current presentation screenshot with issue?mkRabbani
I tried to update the original post to add a text example of what the current presentation looks like.Mike

1 Answers

0
votes

I figured out my issue. PowerBI was letting me use the PREVIOUSDAY function and it was giving me the correct row value but the total was not correct. I used DATEADD instead and the total was correct. I believe PREVIOUSDAY only works if you have officially marked a Date table as a date table.