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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Slicer that changes calculations within visuals

Hello all,

 

I have data of calls for their duration stretching over a range of days. Currently, I am displaying the data to show the total number of calls for each day of the week as below:

 

image.png

 

Right now, it shows the total number of calls. I know how to change the column values to show the average calls per day, but I'm interested in adding a slicer to the side with the "Total" and "Average" options that, when selected changes the calculation in the visual automatically. Is this possible?

 

3 REPLIES 3
parry2k
Super User
Super User

@Anonymous yes that is possible, create a table using following DAX under modelling tab, clicking Data Table

 

Aggregation Selection = DATATABLE( "Aggregation Method", STRING, { { "Average" }, { "Sum" } } )

it will create a table in your model, drop "Aggregation Method" from this table in a slicer and add  a measure or change existing

 

Calls by Aggregation Method = 
VAR __aggregationMethod = SELECTEDVALUE( 'Aggregate Selection'[Aggregation Method], "Sum" )
RETURN
IF ( __aggregationMethod = "SUM", <sum measure>, <average measure> )

 

 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2kI forgot to mention that when averaging, I have other visuals that need to average the call duration by call hour of the day (24 hour clock), and also by caller ID. So I'm not sure if creating a measure is the best to average all the visuals simulatenously. Your solution, however works if there was only one visual.

You can create avg and sun measures and use those wherever you want and the same measure use in this if condition.


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.