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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
nish18_1990
Helper I
Helper I

Dynamic parameter selection for due days

Hi ,

I need a parameter on days selection . If i select Closure in the next 10 calendar days . It should show me the category where the closure date is in next 10 calendar days .

"X" mentioned below would a parameter with dynamic value . Whatever user input there it should show data accordingly .

 

Closure in the next X calendar days

 

This is my data

CategorySub CategorySalesQuantity Q2countryClosure date
FurnitureChairs10010China22/07/2025
FurnitureTables10020China23/08/2025
AutomobileCars10030China21/7/2025
AutomobileBikes70040China21/6/2025
FurnitureChairs10013India21/8/2025
FurnitureTables50022India21/9/2025

 

Thanks

6 REPLIES 6
v-echaithra
Community Support
Community Support

Hi @nish18_1990 ,

Please look into the file attatched below.

Hi @nish18_1990 ,

Thanks for the update, please look into the below pbix file.

If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.

Thanks,
Chaithra E.

johnt75
Super User
Super User

Create a numeric parameter ranging from 1 to the maximum number of days you want to be able to filter for. Then create a measure like

Closure date within X days =
VAR ChosenDays = [Num Days Value]
VAR RefDate =
    SELECTEDVALUE ( 'Table'[Closure Date] )
VAR DaysDiff =
    DATEDIFF ( TODAY (), RefDate, DAY )
VAR Result =
    IF ( DaysDiff <= ChosenDays, 1 )
RETURN
    Result

Add that measure as a filter to your table or matrix visual, set to show only when the value is 1.

Sorry i did tried it but its not working  . I am getting 1 value even if i select any number on parameter . I need like if i select 20 on parameter . It should show categories having closure date in next 20 days from today . 

Could you please attach the power bi file for reference

Here you go

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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