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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
wen2z
New Member

How to show both selected value in the slicer, and the unselected value

Hello Everyone.

I have difficulty on my Power BI.

I want to show the total amount from the Sales Table below.

Order NumberItemAmount
1A100
2B200
3C300
4D400

 

When I filtered it using slicer by order number, the SUM amount that filtered is correct.

The problem is, how to show the Unchecked SUM amount in Card visual on the dashboard??

 

Eg : i checked only 1,2,3 Thus result the sum amount 100+200+300 = 600
i want to display the difference : 4 = 400.

4 REPLIES 4
Dangar332
Super User
Super User

hi, @wen2z 

Try below measure

orsum =
var a = CALCULATE(SUM('order'[amount]),ALLEXCEPT('order','order'[amount]))
var b = SUM('order'[amount])
return ABS(a-b)
 
Dangar332_0-1697780033971.png

 

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.

Hello Dangar, thank you for your feedback.

The measure works. 

But if I combine it with filter by date

Eg: I have 3 years of data (2020 until 2023), and I filtered only to show 2023.

the unselected amount is shows the SUM from 2020 to 2023 plus the document no that I'm not selected.

hi, @wen2z 

use keepfilters inside of var a 

orsum =
var a = CALCULATE(SUM('order'[amount]),ALLEXCEPT('order','order'[amount]),keepfilters('tablename'[datecolumn]))
var b = SUM('order'[amount])
return ABS(a-b)

hi, @wen2z 

here you can check

Dangar332_0-1697784209655.png

here date table seprate and linked with main table

 

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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