Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi there,
I've got a data set and want to use a slicer to as toggle to update a line chart. My slicer entitled "View" has two options Per Area and Per Asset. What I want is whenever I select "Per Asset" for my line chart to just plot the values against the dates I have. See image below:
Next when I selet "Per Area", I'd like my chart to dynamically change by plotting the values against dates per category (legen). See image below:
I'm not sure if there's a way to do this. I'm thinking I need to create a special measure to use within line chart values input that changes with the slicer. The slicer is just a manual table I created with two values as mentioned above and only one can be selected at a time.
Help is appreciated!!
Solved! Go to Solution.
Hi, @jayalmendarez
As @PaulDBrown @AlexisOlson said above, bookmarks and buttons are a good choice.
Here's a blog about how bookmarks and buttons can help:
Bookmarks and Buttons: Making Power BI Charts Even More Interactive
Alternatively, we can get similar results without using bookmarks and buttons.
This is actually a case of dynamic axis
What you need to do is to aggregate the different KPIs into a new calculation table and then use the TREATAS function to filter the table to get the results.
Sample:
_KPI =
VAR table1=SELECTCOLUMNS(
ADDCOLUMNS(VALUES('Table'[Asset]),"KPI","Asset"),
"KPI",[KPI],"category",[Asset])
VAR table2=SELECTCOLUMNS(
ADDCOLUMNS(VALUES('Table'[Area]),"KPI","Area"),
"KPI",[KPI],"category",[Area])
RETURN UNION(table1,table2)value =
SWITCH(TRUE(),
SELECTEDVALUE('_KPI'[KPI])="Asset",CALCULATE(_KPI[_Sales],TREATAS(VALUES('_KPI'[category]),'Table'[Asset])),
SELECTEDVALUE('_KPI'[KPI])="Area",CALCULATE(_KPI[_Sales],TREATAS(VALUES('_KPI'[category]),'Table'[Area]))
)
I've already done this in the thread below using the bar chart as a case study, Modifying my formula can be applied to a line graph, for ease of understanding I've implemented it and posted it here, hope it helps to understand
refer:
help with dax calculation on which date column to use
Please refer to the attachment below for details. Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @jayalmendarez
As @PaulDBrown @AlexisOlson said above, bookmarks and buttons are a good choice.
Here's a blog about how bookmarks and buttons can help:
Bookmarks and Buttons: Making Power BI Charts Even More Interactive
Alternatively, we can get similar results without using bookmarks and buttons.
This is actually a case of dynamic axis
What you need to do is to aggregate the different KPIs into a new calculation table and then use the TREATAS function to filter the table to get the results.
Sample:
_KPI =
VAR table1=SELECTCOLUMNS(
ADDCOLUMNS(VALUES('Table'[Asset]),"KPI","Asset"),
"KPI",[KPI],"category",[Asset])
VAR table2=SELECTCOLUMNS(
ADDCOLUMNS(VALUES('Table'[Area]),"KPI","Area"),
"KPI",[KPI],"category",[Area])
RETURN UNION(table1,table2)value =
SWITCH(TRUE(),
SELECTEDVALUE('_KPI'[KPI])="Asset",CALCULATE(_KPI[_Sales],TREATAS(VALUES('_KPI'[category]),'Table'[Asset])),
SELECTEDVALUE('_KPI'[KPI])="Area",CALCULATE(_KPI[_Sales],TREATAS(VALUES('_KPI'[category]),'Table'[Area]))
)
I've already done this in the thread below using the bar chart as a case study, Modifying my formula can be applied to a line graph, for ease of understanding I've implemented it and posted it here, hope it helps to understand
refer:
help with dax calculation on which date column to use
Please refer to the attachment below for details. Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The best option is probably to use bookmarks and buttons to toggle between visuals
Proud to be a Super User!
Paul on Linkedin.
It might be easier to use buttons and bookmarks for this rather than slicers and measures.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!