Forum Discussion
Need help in visual interaction
- 2 years ago
Hi Anonymous -Ensure that both your table visual and the line chart are using the same timestamp field from the same table or model, so that interactions between the visuals work smoothly.You may also want to format the x-axis of the line chart to show appropriate date intervals (like days) for better visibility.
When you or the end user clicks on any timestamp in the table visual, the SelectedTimestamp measure will capture that value. Then, the IsInRange measure will filter the data on the line chart to show only the data from 5 days before and 5 days after the selected timestamp. This will dynamically update the chart as you click on different timestamps.
IsInRange =
VAR SelectedTime = [SelectedTimestamp]
RETURN
IF (
NOT ISBLANK(SelectedTime),
IF (
'table'[timestamp] >= (SelectedTime - 5) && 'table'[timestamp] <= (SelectedTime + 5),
1,
0
),
1 -- default to showing all data if no timestamp is selected
)use the above flag in visual level filter Set the filter to show only when IsInRange = 1.
Hope it works.
- 2 years ago
Anonymous , The line visual's axis needs to on a disconnected table.
Very similar to this solution
Power BI: Create a 12-Month Trend with Single Slicer Selection on connected Date table- https://www.youtube.com/watch?v=7dPrPk6LPYU&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L&index=2
Hi Anonymous -Ensure that both your table visual and the line chart are using the same timestamp field from the same table or model, so that interactions between the visuals work smoothly.You may also want to format the x-axis of the line chart to show appropriate date intervals (like days) for better visibility.
When you or the end user clicks on any timestamp in the table visual, the SelectedTimestamp measure will capture that value. Then, the IsInRange measure will filter the data on the line chart to show only the data from 5 days before and 5 days after the selected timestamp. This will dynamically update the chart as you click on different timestamps.
IsInRange =
VAR SelectedTime = [SelectedTimestamp]
RETURN
IF (
NOT ISBLANK(SelectedTime),
IF (
'table'[timestamp] >= (SelectedTime - 5) && 'table'[timestamp] <= (SelectedTime + 5),
1,
0
),
1 -- default to showing all data if no timestamp is selected
)
use the above flag in visual level filter Set the filter to show only when IsInRange = 1.
Hope it works.