Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
LYeo87
Helper II
Helper II

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.

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.

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...

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.