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
TexasBI
Helper II
Helper II

Dynamic Filtering of table

Hello, 

 

Please help. I am trying to dynamically filter a table and adjust based on a date selection. is this possible with DAX?

dynamicTable.PNG

1 ACCEPTED SOLUTION
Vera_33
Resident Rockstar
Resident Rockstar

Hi @TexasBI 

 

If you add another disconnected Date table, I am using NewDate in the Slicer, original Date in the visual, or modify the measure2 otherwise

Measure 2 = 
VAR CurDate = SELECTEDVALUE('Date'[Date])
VAR CurNewDate = SELECTEDVALUE(NewDate[Date])
RETURN
IF(CurNewDate in DATESBETWEEN('Date'[Date],EDATE(CurDate,-1),EDATE(CurDate,1)),[Measure])

 

Vera_33_0-1617770269073.png

Measure 2 = 
VAR CurDate = SELECTEDVALUE('Date'[Date])
VAR CurNewDate = SELECTEDVALUE(NewDate[Date])
RETURN
IF(CurNewDate in DATESBETWEEN('Date'[Date],EDATE(CurDate,-1),EDATE(CurDate,1)),[Measure])

 

View solution in original post

3 REPLIES 3
Vera_33
Resident Rockstar
Resident Rockstar

Hi @TexasBI 

 

If you add another disconnected Date table, I am using NewDate in the Slicer, original Date in the visual, or modify the measure2 otherwise

Measure 2 = 
VAR CurDate = SELECTEDVALUE('Date'[Date])
VAR CurNewDate = SELECTEDVALUE(NewDate[Date])
RETURN
IF(CurNewDate in DATESBETWEEN('Date'[Date],EDATE(CurDate,-1),EDATE(CurDate,1)),[Measure])

 

Vera_33_0-1617770269073.png

Measure 2 = 
VAR CurDate = SELECTEDVALUE('Date'[Date])
VAR CurNewDate = SELECTEDVALUE(NewDate[Date])
RETURN
IF(CurNewDate in DATESBETWEEN('Date'[Date],EDATE(CurDate,-1),EDATE(CurDate,1)),[Measure])

 

Hey @Vera_33 

 

Thank you for your help. How did you have your relationships set up? It only returns the same exact number for each column.

Hi @TexasBI 

 

I have a Date table connects with that 3 tables like your screenshot, another Disconnected newDate table, my dummy data is all the same values for every month in every table...

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.