Forum Discussion
Need help on dynamic interactions
Hi Anonymous ,
You can create a measure that dynamically calculates whether a timestamp falls within the 5-day range before or after the selected timestamp.
WithinRange =
VAR SelectedDate = SELECTEDVALUE('table'[timestamp])
VAR StartDate = SelectedDate - 5
VAR EndDate = SelectedDate + 5
RETURN
IF(
'table'[timestamp] >= StartDate &&
'table'[timestamp] <= EndDate,
1, 0
)
Next, in the line chart, add this WithinRange measure to the visual-level filter. Set the filter condition to show values where WithinRange = 1.
Then, set up interaction between the table and the line chart by using the Visual Interactions tool in Power BI. This will ensure that when a user clicks on a timestamp in the table, it dynamically updates the line chart.
Calculated columns would result in static values, whereas using a measure provides dynamic filtering that updates the line chart based on user interactions. This is why using a measure is preferred for this task.
- Anonymous1 year agoNot applicable
sorry, this is not working, when I set up interaction between the table and the line chart by using the Visual Interactions tool in Power BI the line chart is filtered to one value, this is because my X axis is timestamp