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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JimmyCruyp
Helper II
Helper II

Filter and slicer result

Hello, I am looking to create a formula that calculates a sum for certain attributes in a list of attributes based on whether or not I have selected those attributes in a slicer. I want a different result depending on whether they are selected or not. If they are selected, I want the sum of their values. If they are not selected, I want the values to be 0 for each attribute. If they are not selected, I still want them to appear in my result table, so I need to remove the interaction so that the slicer does not filter my result table. I want all attributes to appear in my result table, even those that are not selected, but with a value of 0 for those that are not selected. There are 100 attributes in the list, so I should not name them in my formula. There are sometimes multiple values for each attribute, so the sum needs to be calculated.

7 REPLIES 7
tamerj1
Super User
Super User

@JimmyCruyp 
In this case the Attribute slicer has to come from a dim table. Just create a dim table with all unique attributes and connect it to the main table then use the column from the dim table in the slicer. It should work if add (+ 0) to your measure.

I would like to find a solution without creating an additional table if possible?

No it is not possible. Try this:

Measure 2 =
VAR _sum = sum(Source[Value])
VAR _select = VALUES('Table'[Attribut])
RETURN if(SELECTEDVALUE(Source[Attribut]) IN _select,_sum,0)
 
andhiii079845_0-1679600072081.png

 

andhiii079845_1-1679600168357.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks, I tried this but only one table and it doesnt work. So there is no solution to do that without creating an additonal column?

No, because you want the filter the column and also modify the filter context. This is not possible. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




andhiii079845
Solution Sage
Solution Sage

Can you please make a good data example with the underlaying data how with 1-2 different slicer value and how it should look like? Thank you 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




JimmyCruyp_0-1679393700648.png

For example if I filter in a slicer on attribut B and E (if I select only these attributes in my slicer)

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.