Yesterday Sales But Accounting for Weekend

Used for anything related to the new Power BI Desktop and Service tools
a68tbird
Posts: 32
Joined: Sat Mar 19, 2016 4:58 am
Location: Toronto, ON

Yesterday Sales But Accounting for Weekend

Postby a68tbird » Fri Mar 03, 2017 2:41 am

Hello All,
I have a client that requires daily sales reports, and so I have created a PowerBI dashboard (embedded on a backend page of their website) that gives YTD sales, as well as Yesterday's sales. But "Yesterday's" sales aren't really all that useful on a Monday morning - I'd rather that figure be Friday, Saturday and Sunday.

Yesterday measure is simply


To test for Monday, is just:


My YesterdaySales are calculated as such:


(I put that IF ISBLANK in there to prevent a big (BLANK) from showing up in the visual).

So I can put YesterdaySales into my Monday test as the FALSE result but I'm not quite sure how to sum up three previous days of sales (ie. Friday, Saturday, Sunday) when TODAY = Monday.



Thanks for any suggestions.
Travis

MattAllington
Posts: 846
Joined: Sun May 04, 2014 4:01 pm
Location: Sydney, Australia

Re: Yesterday Sales But Accounting for Weekend

Postby MattAllington » Sat Mar 04, 2017 3:32 pm

I suggest using custom time intelligence. You don't even need to load the weekend dates and you can add an integer ID column for each working day. E.g. The first week of dates mon to fri would be 1-5 and then the second week mon to fri would be 6-10 etc. You can then do time shifting on that column rather than the date column.

I wrote an article about it here
http://exceleratorbi.com.au/dax-time-in ... beginners/
Matt Allington is Professional Self Service BI Consultant, Trainer and Author of the book "Learn to Write DAX". You can hire me at http://Exceleratorbi.com.au
http://exceleratorbi.com.au/what-is-power-pivot/
http://xbi.com.au/learndax


Return to “Power BI Desktop/Service”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest