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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Keirathi
Regular Visitor

Possible to have chart values switch between SUM and COUNT with a slicer?

Hi!  I'm new to Power BI, and as far as I can tell, this isn't possible.  But I figured I would ask anyways.

 

 

So I have a Stacked Column Chart with my Y-Axis currently set as Sum(Price).  So each bar sums up the total price of each item sold.  It was requested to also have a way to directly view the total number of items sold rather than the gross sales.  I played around for a while, but the only way I could figure out to do it was to just make a duplicate page and change the Y-Axis to Count(Item).  I'm just wondering if there's a way to do it where I don't need so many duplicate pages in the report.  Like a Slicer would be ideal in that I could select one or the other on the same page.

 

Am I out of luck?

4 REPLIES 4
gordway
Frequent Visitor

A solution that I had found for this same issue is to create two visuals on the same page of the same size and in the same spot on the page (one for count and one for sum) then drop in two images (such as toggle button images) and assign a bookmark to each of the images that has one of the two visuals hidden using the selection pane and do the same for the other image. 

ankitpatira
Community Champion
Community Champion

@Keirathi rather than having two seperate pages you can just use same visuals side by side one showing sum of sales and other count on the same page.

@ankitpatira  Yea, that works too.  I thought that would feel a little cramped, but it's not as bad as I was expecting.  I switched to that for now.

 

@Anonymous Ooh, that sounds promising!  Thanks, I'll take a look!

Anonymous
Not applicable

You can do something like :

 

The Count := COUNTROWS(MyTable)

The Sum := SUM(MyTable[MyColumn])

The Selected Measure := IF (MIN(MeasureSelectionTable[MeasureName]) = "Sum", [The Sum], [The Count])

 

You would need to build tthe MeasureSelectionTable to support this trickery.

 

Rob Collie calls this a "disconnected slicer" I believe, you might search that term on powerpivotpro.com and see if you can get better info than I provided 🙂

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors