Forum Discussion

cchp07's avatar
cchp07
Frequent Visitor
7 years ago

Day Over Day Variance for Week

am working on a report that I need to show a day over day variance for a 7 day week. I already have a variance Chart to show week over week which I have found on another topic. I have tried to use that same method for the day over day variance, but I am not getting what I am looking for.

 

Example

I get the daily totals correct, but the variance usually shows up 0 which I do not believe is right.

Daily Variance = var lastDayAmount = CALCULATE(sum(AS400[Y1NWGT]), filter(all('AS400'), 'AS400'[Weekday #]=min(AS400[Weekday #])-1)) return DIVIDE(sum('AS400'[Y1NWGT])-lastDayAmount,lastDayAmount,0)

 

I tired: 

 

Variance = var lastWeekAmount = CALCULATE(sum(AS400[Y1NWGT]), filter(all('AS400'), 'AS400'[Week Number]=MIN(AS400[Week Number])-1)) return DIVIDE(sum(AS400[Y1NWGT])-lastWeekAmount,lastWeekAmount,0)
 
And got: 
 
Use Weekly Variance
 
The percentages are off. They all show negative.
 



1 Reply

  • v-diye-msft's avatar
    v-diye-msft
    Community Support

    Hi cchp07 

     

    I tried your measure and it works fine in my simple data, I have no idea about what happened in your data. would you mind sharing me your dummy pbix which let me dig the point?Make sure you've removed the confidential info before.  thanks!

     

    Best regards,

    Dina Ye