Forum Discussion
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
- lbendlin
Super User
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523