Forum Discussion
Dynamic X Axis based on Slicer using Dynamic table or RANKX
Try
Sprint index =
RANKX (
ALL ( 'Table'[Sprint], 'Table'[Start date] ),
'Table'[Start date],
,
ASC
)
Thank you for the RANKX and it is doing exactly what I was looking for.
Once this Index is added I tried your virtual table code as below but unfortunately, the table value is not getting updated based on the Sprint Slicer selection. Below is the Screenshot for your reference.
If the user selects "Sprint 2404" then the chart should show data for Sprint 2404 + Sprint 2403 + Sprint 2402. This means the new table should have Sprint Values: 2404, 2403, and 2402.
If the user selects "Sprint 2403" then the chart should show data for Sprint 2403 + Sprint 2402 + Sprint 2401. And here the new table should have Sprint Values: 2403, 2402 and 2401.
I think we should fill the new Dynamic Table with:
Sprint Name that was selected by the user in the Slicer +
Append Sprint Name from the Sprint table that has Index - 1 of the Selected Sprint Index.
Append Sprint Name from the Sprint table that has Index - 2 of the Selected Sprint Index.
This is just my thought but not sure of that is possible. This will ensure the Dynamic table has updated Sprint values based on Slicer Selection and can be used as X Axis.
Thanks,
Prabhat
Velocity Sprints =
SELECTCOLUMNS(
GENERATE(
SUMMARIZE( 'Sheet1', 'Sheet1'[Sprint Name], 'Sheet1'[Sprint Index]),
VAR CurrentIndex = 'Sheet1'[Sprint Index]
RETURN GENERATESERIES( MAX( CurrentIndex - 2, 1), CurrentIndex)
),
"Sprint", 'Sheet1'[Sprint Name],
"Sprint number", [Value]
)