Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
mjohannesson
Advocate I
Advocate I

Dynamic index on X axis

I have a table similar to this:

SalesDateProductSalesAmount
2020-01-01A100
2020-01-06B50
2020-01-10A200

 

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 3
v-eachen-msft
Community Support
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.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
jthomson
Solution Sage
Solution Sage

How is your measure worded? This should just work with a standard slicer/filter on your product

 

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.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.