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
Ncio
Helper II
Helper II

Measure slicer: sum when multiple selection?

Hello,

 

I've implemented a "measure slicer" that works well: using the slicer, I can select one mesure. 

 

I have a table with the values "filter1", "filter2", "filter3" that I use in a slicer.

And I use the following measure (simplified): 

Graph: Slicer Cumul annuel =
IF(HASONEFILTER('KPI: Slicer'[Type]),
SWITCH(SELECTEDVALUE('KPI: Slicer'[Type]),
"filter1", [KPI1],
"filter2", [KPI2],
"filter3", [KPI3],
),
BLANK()
)

 

==> Now, i'd like to be able to select multiple values in the slicer, and it would sum all selected mesures.

  • For instance, if I select "filter1" and "filter2" using the slicer, i'd like to have KPI1 + KPI2
  • Currently,
    • because of "HASONEFILTER", no calculations are done if I have more that one filter.
    • And "SELECTEDVALUE" works only if there is only one value.

Thank you,

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Ncio , try like

 

Graph: Slicer Cumul annuel =
calculate(

if(countx(filter('KPI: Slicer'[Type] , 'KPI: Slicer'[Type] = "filter1"),'KPI: Slicer'[Type] )+0 > 0, [KPI1],0)+
if(countx(filter('KPI: Slicer'[Type] , 'KPI: Slicer'[Type] = "filter2"),'KPI: Slicer'[Type] )+0 > 0, [KPI2],0)+
if(countx(filter('KPI: Slicer'[Type] , 'KPI: Slicer'[Type] = "filter3"),'KPI: Slicer'[Type] )+0 > 0, [KPI3],0)
)

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

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi, @Ncio 

Please check the below picture and the sample pbix file's link down below.

The left side chart is the single selection, and the right side chart is the multi-selection (Sum).

Once you multi-select the slicer, the left chart will go back to the default, and the right chart will sum the selected measures.

All measures are in the sample pbix file.

 

Picture2.png

 

https://www.dropbox.com/s/n1hwfr92e4ib8v9/diffaaa.pbix?dl=0 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
MikeJohnsonZA
Responsive Resident
Responsive Resident

Assuming that all your measures return numbers you should be able to do something like

 

New Measure = sumx(values('measure slicer'[measure]),[Slicer Cumul annel])

 

This pattern might not perform very well as you add more visuals, measures or data to the report but should work.

 

 

 

amitchandak
Super User
Super User

@Ncio , try like

 

Graph: Slicer Cumul annuel =
calculate(

if(countx(filter('KPI: Slicer'[Type] , 'KPI: Slicer'[Type] = "filter1"),'KPI: Slicer'[Type] )+0 > 0, [KPI1],0)+
if(countx(filter('KPI: Slicer'[Type] , 'KPI: Slicer'[Type] = "filter2"),'KPI: Slicer'[Type] )+0 > 0, [KPI2],0)+
if(countx(filter('KPI: Slicer'[Type] , 'KPI: Slicer'[Type] = "filter3"),'KPI: Slicer'[Type] )+0 > 0, [KPI3],0)
)

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

Works perfectly, thanks!

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