Forum Discussion
Dates based on Slicer selection
- 1 year ago
Hi Jyaul1122 ,
Thank you for reaching out to Microsoft Fabric community.I got this working and thought I’d share how I did it,
I generated a separate slicer table from Fact[Data_Date] by creating a calculated table as shown below:
Slicer_Date = DISTINCT(Fact[Data_Date])There’s no relationship between this table and any other — it’s just used for the slicer.
Then I created a measure to check if each date in the matrix should be shown, based on the slicer selection:
Show Column = VAR SelectedDate = SELECTEDVALUE(Slicer_Date[Data_Date])
VAR ThisColumnDate = SELECTEDVALUE(Dates[Dates])
RETURN
IF (
NOT ISBLANK(SelectedDate) &&
NOT ISBLANK(ThisColumnDate) &&
ThisColumnDate,
1,
0
)And finally, this is the measure I used to get the actual date values in the matrix:
Selected Actual Date =
VAR SelectedDate = SELECTEDVALUE(Slicer_Date[Data_Date])
VAR ThisDate = SELECTEDVALUE(Dates[Dates])
VAR ThisProject = SELECTEDVALUE(Fact[Project])
RETURN
IF (
NOT ISBLANK(SelectedDate) &&
NOT ISBLANK(ThisDate) &&
NOT ISBLANK(ThisProject) &&
ThisDate <= SelectedDate,
CALCULATE (
MAX(Fact[Actual Date]),
FILTER (
Fact,
Fact[Project] = ThisProject &&
Fact[Data_Date] = ThisDate
)
)
)In the matrix, I placed Dates[Dates] on the rows, Fact[Project] on the columns, and used the Selected Actual Date measure as the value. I also applied Show Column as a visual-level filter, setting it to 1 so that only columns on or before the selected date are displayed.
The slicer uses the Slicer_Date table we set up initially.
Everything is functioning as intended the matrix updates according to the selected date and displays only the relevant values up to that point.
Please find the attached .pbix file for your reference
Regards,
Sreeteja.
Hi Jyaul1122 ,
I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you
Hi Jyaul1122 ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions