Forum Discussion
Dynamic index on X axis
I have a table similar to this:
| SalesDate | Product | SalesAmount |
| 2020-01-01 | A | 100 |
| 2020-01-06 | B | 50 |
| 2020-01-10 | A | 200 |
I have a measure with the cumulative sales amount and I would like to create a line chart with the measure as the value and having a dynamic index on the X axis. I.e. if there are no filters there should be 100, 150 and 350 in the chart and 1, 2, 3 on the X axis, and if the chart is filtered on product A, there should be 100 and 300 in the chart and 1, 2 on the X axis. How can I accomplish this?
3 Replies
- jthomson
Solution Sage
How is your measure worded? This should just work with a standard slicer/filter on your product
- mjohannesson
Advocate I
CumulativeSalesAmount = CALCULATE(SUM(F_Sales[SalesAmount]), FILTER(ALL(F_Sales), F_Sales[WkSalesDate] <= MAX(F_Sales[WkSalesDate])))This works fine if I put the sales date (from the related Date dimension) on the X axis, but I would like to have a sequential index on the X axis instead.
- v-eachen-msft
Community Support
Hi mjohannesson ,
X-axis is based on column which is static, you could show/hide some of x-axis. But Power BI doesn't support dynamic x-axis value.