cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LYeo87
Helper I
Helper I

Excluding Dates that fall within last 3 days of 'Today' - Rolling

Hi - I have been tasked with presenting a report to an external client, but we only want them to see data prior to the last 3 days at any given point.

 

So for example - we have a table of 'Job Names' and the date these Jobs were 'Reported'

 

I have a 'Reported on date' column; but the relative date filters dont give me this option.  

 

What other page filter options could I apply?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@LYeo87 , Examples With help from a date  table

 

Rolling 30 before 3 day = CALCULATE(sum('Table'[Number]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]) -3,-30,Day))

Rolling 60 before 3 day = CALCULATE(sum('Table'[Number]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]) -3,-30,Day))

 

Rolling 30 before 3 day = CALCULATE(sum('Table'[Number]),DATESINPERIOD('Date'[Date],Today() -3,-30,Day))

Rolling 60 before 3 day = CALCULATE(sum('Table'[Number]),DATESINPERIOD('Date'[Date],Today() -3,-30,Day))

 

all before 3

CALCULATE(sum('Table'[Number]),filter(Date, Date[Date] <=Today() -3 )

or

CALCULATE(sum('Table'[Number]),filter(all(Date), Date[Date] <=Today() -3 )

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@LYeo87 , Examples With help from a date  table

 

Rolling 30 before 3 day = CALCULATE(sum('Table'[Number]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]) -3,-30,Day))

Rolling 60 before 3 day = CALCULATE(sum('Table'[Number]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]) -3,-30,Day))

 

Rolling 30 before 3 day = CALCULATE(sum('Table'[Number]),DATESINPERIOD('Date'[Date],Today() -3,-30,Day))

Rolling 60 before 3 day = CALCULATE(sum('Table'[Number]),DATESINPERIOD('Date'[Date],Today() -3,-30,Day))

 

all before 3

CALCULATE(sum('Table'[Number]),filter(Date, Date[Date] <=Today() -3 )

or

CALCULATE(sum('Table'[Number]),filter(all(Date), Date[Date] <=Today() -3 )

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!

Thank you thats fab.

 

Similarly I also only want to show dates prior to this month? I'm aware of STARTOFMONTH - but unsure how to use this correctly. 

@LYeo87 , You can use time intelligence for that

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
next month Sales = CALCULATE(SUM(Sales[Sales Amount]),nextmonth('Date'[Date]))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
Power BI — Qtr on Qtr with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
https://www.youtube.com/watch?v=8-TlVx7P0A0
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8
Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!

Thank you very much. These are all very helpful tips.

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!