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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Filter rows of a table by a what if parameter

Hello,

 

Context:

I have a table named "Projects" with two columns: Project and Project_Date.

On the report, there is a table and a slider linked to a What-if parameter (Days_Th) which is a number between 1 and 30.

 

Objective:

I want to display all the lines of the table with Project_Date in [today, today + Days_Th] (days_th is a number defined by a what-if parameter).

 

What I have tried:

Creating a calculated column with a IF statement and filter the table with this column.

Computed Column = IF(AND(Projects[Project_Date] >= NOW(), Projects[Project_Date] <= NOW() + Days_Th[Valeur Days_Th]), 1, 0)
 
Issue:
The column filter works fine, but it doesn't update dynamically when I change the slider.
I've tried to use Measures but I didn't suceed with it.
 
Thank you for your help
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You can not use the slicer value in a calculated column , you need to create a measure

 

exameple

 

countx(Projects, IF(AND(Projects[Project_Date] >= NOW(), Projects[Project_Date] <= NOW() + Days_Th[Valeur Days_Th]), 1, 0) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thank you for the tip. The COUNTX didn't work so I replaced it with a SUMX which seems to work!

 

Thank you very much 🙂

amitchandak
Super User
Super User

@Anonymous , You can not use the slicer value in a calculated column , you need to create a measure

 

exameple

 

countx(Projects, IF(AND(Projects[Project_Date] >= NOW(), Projects[Project_Date] <= NOW() + Days_Th[Valeur Days_Th]), 1, 0) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors