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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Use slicer control x-axis range

Hi all,

I would like to build a stacked column chart and use a slicer to control the range of the x-axis without changing the value of the axis. (Just like changing the minumum and maximum number in Format - X-axis, but with a slicer).

For example, the chart shows the cumulative amount of products sold since year 2005. (The data source is additional products sold each year, so I used a running total measure to let the chart display the cumulative amount of products.)
2005:5,

2006:14 (9 products sold in year 2006, so a total of 5+9=14 products are sold)

2007: 21

2008:23.....

when slicer is: year : 2005 - 2023, the chart should have 19 columns ( 2005 : 5, 2006 : 14, 2007 : 21, 2008 : 23,..., 2023 : 900)

when slicer is: year : 2007 - 2023, the chart should have 17 columns ( 2007 : 21, 2008 : 23,..., 2023 : 900).

I have tried to use a slicer directly, but this when slicer is year: 2007 - 2023, the chart gives me ( 2007 : 7, 2008 : 9,..., 2023 : 886), which is not what I want.

 

Thanks in advance for your help!

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

How are you calculating the running total value it seems to me that you are using the values only for the selected period making the values to restart when you select each of the values.

 

You need to have a measure similar to this one:

 

Running sum = CALCULATE(SUM('Table'[Sold]), 'Table'[Year] <= MAX('Table'[Year]))

Has you can see in the image below the values that are filtered continue to have the cumulative amounts.

MFelix_0-1719563326217.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @Anonymous ,

 

How are you calculating the running total value it seems to me that you are using the values only for the selected period making the values to restart when you select each of the values.

 

You need to have a measure similar to this one:

 

Running sum = CALCULATE(SUM('Table'[Sold]), 'Table'[Year] <= MAX('Table'[Year]))

Has you can see in the image below the values that are filtered continue to have the cumulative amounts.

MFelix_0-1719563326217.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi @MFelix ,

Thanks for your help! I modified my measure according to the example you gave, and it works for me right now!
Your quick response really helped me a lot! Thanks again!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors