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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.