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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
ralph_schroeder
Frequent Visitor

Forecast Days Parameter in DAX

In Report Builder, I have a task activity table with due date.  I want to have a user select a report parameter "Forecast Days" (=7 days, 30 days, 90 days) that filters the task due date.  So for example, selecting "30 Days" the table will show task due dates between today and +30 days.  What is the DAX for this?  Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ralph_schroeder ,

 

Create a table like below and use it as slicer.

vjaywmsft_0-1654681358491.png

Then create a measure like below and add it to visual filter set value = 1.

Measure =
IF (
    SELECTEDVALUE ( 'Table'[Date] ) <= TODAY ()
        && SELECTEDVALUE ( 'Table'[Date] )
            > TODAY () - SELECTEDVALUE ( slicer[slicer] ),
    1
)

vjaywmsft_1-1654681479971.png

vjaywmsft_2-1654681556775.png

 

Best Regards,

Jay

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @ralph_schroeder ,

 

Create a table like below and use it as slicer.

vjaywmsft_0-1654681358491.png

Then create a measure like below and add it to visual filter set value = 1.

Measure =
IF (
    SELECTEDVALUE ( 'Table'[Date] ) <= TODAY ()
        && SELECTEDVALUE ( 'Table'[Date] )
            > TODAY () - SELECTEDVALUE ( slicer[slicer] ),
    1
)

vjaywmsft_1-1654681479971.png

vjaywmsft_2-1654681556775.png

 

Best Regards,

Jay

DimaMD
Solution Sage
Solution Sage

Hi, @ralph_schroeder 
You can create a Numeric parameter, and use the DATEADD function

CALCULATE(
         [measure],
            DATEADD('Dates'[Date],
                [Value "Parameter"],
                DAY)
            )

__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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