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
Anonymous
Not applicable

Show the sum of unselected values

Hey guys

 

How can I perform the sum of values that are not selected? For instance, in this very simple document I created a table that contains only three columns, and what I aim to do is to compute the sum of the selected values on the category slicer and show a specific number for the non-selected ones (as an example, lets say 1).

Pedro503_0-1666133884156.png

The Book Category filters the subcategory Brand 1 and 2; Pencil, Brand 3 and 4; lastly, Scissor filters brands 5 and 6.Untitled.png 

Now, here follows an example of what I want to get off a measure:

Untitled2.png

If I filter Pencil, then the result would be:

Subcategory       Measure

Brand 1                     1.0

Brand 2                     1.0

Brand 3                     56.60

Brand 4                     82.77

Brand 5                     1.0

Brand 6                     1.0

 

And the same for Scissors.

 

I've tried computing the result by using ISFILTERED(), however it did not work.

 

 

Measure = 
var soma = SUM('Fact'[Cost])
var selecionados = IF(ISFILTERED('Fact'[Category]), soma, 1)
return selecionados

 

 

Any thoughts on how to do that?

 

Thanks in advance.

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

One of ways to achieve this is to have disconnected slicer like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_1-1666156288204.png

 

 

Jihwan_Kim_0-1666156267495.png

 

 

Expected result measure: =
IF (
    HASONEVALUE ( Data[Subcategory] ),
    IF (
        COUNTROWS (
            FILTER ( Data, Data[Category] IN DISTINCT ( 'New Slicer'[Category] ) )
        ) >= 1,
        SUM ( Data[Measure] ),
        1
    )
)

 


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.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

One of ways to achieve this is to have disconnected slicer like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_1-1666156288204.png

 

 

Jihwan_Kim_0-1666156267495.png

 

 

Expected result measure: =
IF (
    HASONEVALUE ( Data[Subcategory] ),
    IF (
        COUNTROWS (
            FILTER ( Data, Data[Category] IN DISTINCT ( 'New Slicer'[Category] ) )
        ) >= 1,
        SUM ( Data[Measure] ),
        1
    )
)

 


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.
Anonymous
Not applicable

Thank you very much, buddy! It really worked.

 

A while ago I've posted a topic akin to this very one, and when I tried to replicate the formula you posted above it has not worked (but indeed worked for this current topic). Do you know why?

 

Once again, thanks for your response.

 

Kudos to you!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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