Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi, I have a relative date slicer how to capture the entered value?
i have a measure i passed static value of 4 , instead of this i need to pass the relative slicer entered value
this is my measure
Measure =
SWITCH(
TRUE(),
SELECTEDVALUE(Table1[CreatedDate]) = BLANK(), 1,
SELECTEDVALUE(Table2[Schedule date]) <= SELECTEDVALUE(Table1[CreatedDate]) &&
SELECTEDVALUE(Table2[Schedule date]) >= SELECTEDVALUE(Table1[CreatedDate]) - 4, 1,
0
)
in this measure used for top table row filter based bottom table value filtering so i need to change dynamically pass slicer entered value
Reference
i have attached sample data
Thanks
Solved! Go to Solution.
Hey @itsranga,
That could possibly be a difference between today's date and min date in filter context. You can check the following approach:
relativeDays =
VAR _minDate = MIN(calTab[Date])
VAR _diff = TODAY() - _minDate
RETURN INT(_diff)+1
Hope it helps!
I have attached pbix file for your reference, i have 2 table top table if i select any row created date based bottom table filter schduled date to below 4 tables ,
instead of Staic value of 4 days i need dynamically filter selected row - slicer enterd date this one im using measure
relativeDays = VAR _minDate = MIN(calTab[Date]) VAR _diff = TODAY() - _minDate RETURN INT(_diff)+1
this is working im getting slicer enterd date but if i pass the value to measure means its not working
@itsranga, I believe it works fine, there are likely some other issues in your report/data model, i.e. why would you have the interaction between visuals disabled?
you have defined what your expected result is? this would be needed to test the solution.
Proud to be a Super User!
I have attached pbix file for your reference, i have 2 table top table if i select any row created date based bottom table filter schduled date to below 4 tables ,
instead of Staic value of 4 days i need dynamically filter selected row - slicer enterd date this one im using measure
relativeDays = VAR _minDate = MIN(calTab[Date]) VAR _diff = TODAY() - _minDate RETURN INT(_diff)+1
this is working im getting slicer enterd date but if i pass the value to measure means its not working
Hey @itsranga,
Have you tried to add the measure that I suggested as a first step and then using it in your main measure? Doesn't that work as expected?
This is how it should look like:
Measure =
SWITCH(
TRUE(),
SELECTEDVALUE(Table1[CreatedDate]) = BLANK(), 1,
SELECTEDVALUE(Table2[Schedule date]) <= SELECTEDVALUE(Table1[CreatedDate]) &&
SELECTEDVALUE(Table2[Schedule date]) >= SELECTEDVALUE(Table1[CreatedDate]) - [relativeDays], 1,
0
)
@wini_R Its not working, its filter all the date attached screenshot
if i select any row on the first table bottom table filter selected date to last 5 days
@itsranga, I believe it works fine, there are likely some other issues in your report/data model, i.e. why would you have the interaction between visuals disabled?
@wini_R for testing purpose i disabled then i forgot, its works na could you please attach that pbix file
@itsranga, I just opened the file you attached earlier, didn't modify anything. Just enable the interaction back and check if it works as expected
Hey @itsranga,
That could possibly be a difference between today's date and min date in filter context. You can check the following approach:
relativeDays =
VAR _minDate = MIN(calTab[Date])
VAR _diff = TODAY() - _minDate
RETURN INT(_diff)+1
Hope it helps!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
74 | |
63 | |
39 | |
38 |