Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Ash10
Regular Visitor

Need help in visual interaction

Hi, 

 

I have a table visual which has a timestamp column and a line chart with same timestamp column in X axis.

Now when I/end user click on any time stamp value I need the line chart to display last 5 days and next 5 days values and dynamicaly changes based on selected timestamp value. 

 

I tried created two measures as last5Day = selectedvalue('table'[timestamp]) - 5 and next5Day = selectedvalue('table'[timestamp]) + 5, now I tried adding these two measures in minimum and maximum X axis vales in visualization pane, but it is not working. 

If any leads please let me know. Thanks in Advance

2 ACCEPTED SOLUTIONS
rajendraongole1
Super User
Super User

Hi @Ash10 -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. 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

amitchandak
Super User
Super User

@Ash10 , 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

 

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Ash10 , 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

 

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
rajendraongole1
Super User
Super User

Hi @Ash10 -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. 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.