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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
hillad92
Frequent Visitor

Present data between a time range

Hi!

I'm trying to add a date slicer to the dashboard, so the dashboard will present data from the last/next three months.

I add columns with calculated dates and tried to add them to the filter in the slicer options, but it doesn't work. The dashboard still present data from other dates.

 

How does it possible to add default values to a slicer?

 

Thanks in advance,

1 ACCEPTED SOLUTION
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

Based on my understanding, you can create a calendar table. Create calculated column to get Year, Month,Week.

Year = YEAR(Test[Date])
Month = MONTH(Test[Date])


Second, create tree measures using the formulas.

last/next three month = CALCULATE(MAX(Fact[value]),FILTER(Fact,(Fact[Month]<=MONTH(MAXX(ALL(Test),Test[Date]))+3)&&(Fact[Month]>=MONTH(MAXX(ALL(Test),Test[Date]))-3)))


Third, create a new table including the values and the[last/next three month] value.

If this is not what you want, please share your sample table for further analysis.


Thanks,
Angelia

View solution in original post

2 REPLIES 2
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

Based on my understanding, you can create a calendar table. Create calculated column to get Year, Month,Week.

Year = YEAR(Test[Date])
Month = MONTH(Test[Date])


Second, create tree measures using the formulas.

last/next three month = CALCULATE(MAX(Fact[value]),FILTER(Fact,(Fact[Month]<=MONTH(MAXX(ALL(Test),Test[Date]))+3)&&(Fact[Month]>=MONTH(MAXX(ALL(Test),Test[Date]))-3)))


Third, create a new table including the values and the[last/next three month] value.

If this is not what you want, please share your sample table for further analysis.


Thanks,
Angelia

Salvador
Responsive Resident
Responsive Resident

Hi,

 

You could try making a column that reflects the time diff between the date you wanna check, and "now()", and then apply filters that force it to be up to +-90 days. I use this formula: 

Collections Delay =  

    SWITCH ( 

    TRUE (); 

    Now() < Invoices[Overdue Date]; DATEDIFF ( NOW();Invoices[Overdue Date]; DAY )* -1; 

    Now() > Invoices[Overdue Date]; DATEDIFF ( Invoices[Overdue Date]; Now(); DAY ); 

    0)

 

So, if this is between -90 and +90, only data from that period will be shown.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.