Forum Discussion
Bansi008
Helper III
1 year agoHow create relationship from one tab to other,
Hi All - In my PowerBI dashboard, I have two visualization tabs. One tab name is Single Period Data, and another tab is Monthly Data. In the single period data tab, I have added a slicer for a date f...
Akash_Varuna
Super User
1 year agoHi , Try these steps please
- Enable Sync Slicers from the View tab and sync the date slicer between both tabs.
- Create a DAX measure for the last 5 years based on selected date
FilteredDate =
VAR SelectedDate = MAX('Table'[Date]) -- Date selected in the slicer
RETURN
IF (
'Table'[Date] >= DATE(YEAR(SelectedDate) - 5, MONTH(SelectedDate), DAY(SelectedDate)) &&
'Table'[Date] <= SelectedDate,
1,
0
) - Apply FilteredDate = 1 as a visual filter on the Monthly Data tab visuals.
If this helps please do give a kudos and accept this as a solution
Thanks in Advance
Bansi008
Helper III
1 year agoThank you, but this DAX query is not providing the desired output. I have provided screenshot where 1 appears to be for more than 5 years month-end dates. I have selected the 12/31/2024 date in the main slicer. My expectation is that based on this date, i.e., 12/31/2024 (which is selected from other tab slicer), the DAX query should calculate and flag those month-end records that fall within the last 5 years and rest flag as 0. but this is not happening.
Any amendments if you could suggest?