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
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
Solved! Go to Solution.
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.
Proud to be a 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
@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
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.
Proud to be a Super User! | |
User | Count |
---|---|
112 | |
94 | |
87 | |
75 | |
65 |
User | Count |
---|---|
138 | |
112 | |
109 | |
98 | |
93 |