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
jblindsey
Frequent Visitor

Configuring Sparkline X-Axis

I have a matrix with one numeric value and a sparkline on that value.

 

There is also a slicer (Year) that is also being used as the X-axis on the sparkline.   What I'm trying to do is select only one value from the Year slicer, but show the previous five years on the sparkline X-axis.  The image below shows what the matrix looks like when two Years are selected - the sparkline has two data points.  However, the Area Value measure is also aggregated for the two Years.  Any ideas as to how I might select only one Year from the slicer (thus, the Area Value measure represents just the one Year), but show multiple Year data points on the Area Value sparkline?

 

jblindsey_0-1647635175007.png

Thanks.

 

 

4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Hi @jblindsey ,

 

Based on your description, the built-in sparkline of power Bi does not support dynamic change of axis. Please try DAX for svgimages sparkline.

Please refer to:

https://community.powerbi.com/t5/Desktop/Dax-for-SVGImages-sparkline/m-p/1092683 


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you Liang.  I will take a look at SVGImages to see if it will work for me.

amitchandak
Super User
Super User

@jblindsey , if you want select one year and want to show data for 5 year, you need have an independent date/year slicer and use that to get 5 year data measure  

 

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = eomonth(_max, -60) +1
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you Amit.  I've been using your information to see if it will work in my scenario.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors