cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
aganes Frequent Visitor
Frequent Visitor

Cannot show paid total from yesterday using PREVIOUSDAY()

Hi PBI Community,

 

I'm trying to build a dashboard where the user can input a date, and it will show them comparative metrics:

 

  • This year vs. Previous Year
  • This Quarter vs. Previous Quarter
  • This Month vs. Previous Month
  • This Day vs. Previous Day

The Previous Day view has been giving me difficulty. I've structured my query as follows:

 

PaidTotalIssue.PNG

 

...but for some reason, 'PaidTotalYesterday' shows the same as the today value. This is especially confusing because I was able to get metrics for last year/quarter/month using a similarly structured query, however it is not working when I apply this to the day. 

 

I am also able to get a working 'Yesterday' column via PREVIOUSDAY('Dates'[Day]) but cannot apply this to the 'PaidTotalYesterday' column.

 

Any help would be greatly appreciated!!!!

 

Some other info:

  • 'PaidTotalDay' is SUM('Transactions'[paidTotal]) ----- The sum of all line items
  • I've linked my transaction table to a calendar table called 'Dates' that includes every day that we have received a transaction.
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Cannot show paid total from yesterday using PREVIOUSDAY()

Hi @aganes 

Based on my attached sample file,it seems correct.Could you share more details about your scenario?You may also try the second measure for your data.

PaidTotalYesterday2 =
CALCULATE (
    [PaidTotalDay],
    FILTER ( ALL ( Dates ), Dates[Date] = MAX ( Dates[Date] ) - 1 )
)

1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Community Support Team
Community Support Team

Re: Cannot show paid total from yesterday using PREVIOUSDAY()

Hi @aganes 

Based on my attached sample file,it seems correct.Could you share more details about your scenario?You may also try the second measure for your data.

PaidTotalYesterday2 =
CALCULATE (
    [PaidTotalDay],
    FILTER ( ALL ( Dates ), Dates[Date] = MAX ( Dates[Date] ) - 1 )
)

1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
aganes Frequent Visitor
Frequent Visitor

Re: Cannot show paid total from yesterday using PREVIOUSDAY()

Thank you so much @v-cherch-msft! Your FILTER suggestion worked perfectly. Weird it didn't work with PREVIOUSDAY... that must have something to do with the way my calendar table is derived.

 

Much appreciated!

Alex