Forum Discussion

anjumh's avatar
anjumh
New Member
2 years ago

Dynamically set date range of chart based on selected slicer value

Hi,

I want to create a dynamic date range to use as the X-Axis of a Line chart based on selected value from a slicer.

 

Details:

In the table that I have imported to PBI, I have 3 columns that are of particular interest to this task.
1) TestName (e.g. Test 1, Test 2, Test 3)
2) TestStartDate (mentions the start date of the exam in the TestName column e.g. 04/11/2023)
3) TestEndDate (mentions the end date of the exam in the TestName column e.g. 17/11/2023)

How do I get a dynamic date range to use as the X-axis of the Line Chart? So that in the TestName slicer if I choose "Test 1" then the X-axis date range is 04/11/2023 to 17/11/2023 but if choose Test 2 the X-axis changes to 20/11/2023 to 30/11/2023?

 

The Y-axis of the chart is number of students who attended each day of the test from TestStartDate to TestEndDate.

This is rather urgent and as such quick reply would be greatly appriciated.

1 Reply