Multi Day Analysis not working

I am using the report you have shown Sam for Multi Threaded Dynamic Visuals in Power BI - Advanced Power BI and DAX Techniques, but seem anything < 90 days is not showing up for me.

please advise.
I have my Dates Table
image

Day Ranges

Total Revenue Function. I have written exact same as yours, as it is not working.If I select 14 days it is not showing anything - see further.

14 Days ??

180 Days seems fine

Thanks

Just double check the actual data there. It’s very likely that the data is old and doesn’t actually go up to today.

So when you looking back 90 days, there just is not data, so nothing is showing up.

I would overlay the techniques into some live data to see it work better.

Or you can also download the multi threaded dynamic visual examples here - https://enterprisedna.co/power-bi-resources

This data has been updated

Chrs

Hi Sam
Thanks for the reply.
Erm okayy…Not sure i am fully understanding the logic in this.
Okay so i understand if the dates range has not got 90 days, nothing will show up, but if you see the 3rd visual , it has blanks where I have shown 14 days back?

I am completing the video in “Dashbaord Data Viz Intensive” the retail site development, yours dates you have is looking forwards another year 2019. (you have updated) but what if my dates only has 3 years back from , e.g… 2014-2017 dates, question is can i still use this visual techniuqe?

Shrik

Yep I think you actually have it.

You can use this technique if you have historic data BUT instead of using TODAY() as the starting point, you’ll want to use the last date in your dataset.

That way when you go back say 14 days you’ll be looking backwards from the last date in your data versus the actual date today.

Hi Sam
ahh! think i am now starting to get the logical! The reason why I have been so eager to learn this is simply put I think its a great pieice of analysis for anyone to have!

So just to make sure I am on the righr right I could use LASTDATE dax function instead of using TODAY because likely in my situation my date, data set will not have"Today date for me to use TODAY dax function. So i could just change below to LASTDATE.

Revenue Timeframe = CALCULATE([Total Revenue],
                        FILTER('Date',
                               'Date'[Date]<=TODAY() && 'Date'[Date]>=TODAY() - [Time Frame Selected]))

This is mine version of the multi day.

Yep exactly right.

You could also place the LASTDATE( Order date) as a variable as well. That would probably be cleaner.

Sam just wanted your eyes on this if u dont mind
I am practcing the Multi Days Business example, of the website data attached on this portal site.

So this - SELECTEDVALUE
Time Frame Selected = SELECTEDVALUE( ‘Date Range’[Days],40)

This parts seems to be working well

image

image

My calculate with Time Frame seem like it is not liking my function. And i’m using LASTDATE on website date columns. See below.

image

No exactly sure I’m seeing the problem here.

But maybe try placing LASTDATE(Website Data[Date]) firstly into a variable. I think this will be cleaner and what what you will likely also have to do it wrap it inside of CALCULATE because at the moment it’s probably evaluating to the actual date for every day.

So your variable should look something like this.

CALCULATE( LASTDATE( Website Data[Date]), ALL( Website Data ) )

Try this

Hi Sam.

So you know as you told me if I had a date column where it had historical dates, instead of using TODAY() I could use LASTDATE (Order or website column). So this example I was trying this on the Website data u have on this portal. This issue I am having is the below function does not work currently. So which i click on 7day, or 14, or 30 it does not update how it does when I use TODAY() way.

Sales Test Timeframe =
CALCULATE([Sales],
FILTER(‘Date’,
‘Date’[Date]<=LASTDATE(‘Website Data’[Date]) &&
‘Date’[Date]>=LASTDATE(‘Website Data’[Date]) - [Time Frame Selected]))

So before I had posted my very first query on LASTDATE I tried it using the variables and i got blanks.
see below.

Hope this helps. Thanks in advance.
Thanks just really keen on gettting this business concept nailed! :):grinning:

so I’ve tried your way, still get blanks as the end output.

I think your time frame selection is in the wrong place. It should be in the first part of the equation versus the last part as you have it now.

Try that.

So my timeframe should be included as another Variable?
So i’m testing it out a few ways but still confusing me as to the logic.
ermm this is what i’ve done.

Can u please send me some sort of screen shot of what u mean Sam?
Happy to test this and see if this works?

No you have the time frame selection in the wrong place in your formula

If should read like the below

Sales Test Timeframe =
CALCULATE([Sales],
FILTER(‘Date’,
‘Date’[Date]>=LASTDATE(‘Website Data’[Date]) - [Time Frame Selected] &&
‘Date’[Date]<=LASTDATE(‘Website Data’[Date])))

Hi Sam
I have double checked my application with the function you gave me.
Still nothing changes.

Last date needs to be a variable I would say also here. Try that

looks like it is getting better.
However the 7 days from 01/03/2016 going 7 days backwards is not showing the right one.
I bet it is something like really minor i now i cannot figure out…

Here was the variable I recommended

CALCULATE( LASTDATE( Website Data[Date]), ALL( Website Data ) )

This will give you the last date in your website data. Your LASTDATE variable is still not calculating what you need in my opinion.

Hi Sam.
Great have just been trying this DAX concept and it seems to be working great!
Will just practice this concept on a few examples.

Thank u for the advice/help.

Shrik