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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
kmes40505
Frequent Visitor

ALLSELECTED with specific column

I'm using multiple slicers. The goal is to select a subtable of one slicer out of the original whole data(not affected by other slicers if the user use any of them)

 

ALLSELECTED('table'[targetColumn]) doesn't work since this would still be affected by the other slicers

1 ACCEPTED SOLUTION

@kmes40505 your measure should be

 

TotalCount = CALCULATE(SUM(Sheet1[count]),ALLEXCEPT(Sheet1, Sheet1[targetSlicer]))


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

7 REPLIES 7
parry2k
Super User
Super User

@kmes40505 i just tested, a table with 3 column and following measure give me count of all rows regardless if user slicer the data from another columns

 

 

Measure = 
VAR x = CALCULATETABLE( ALLSELECTED(  Table1[Column1] ) )
RETURN
COUNTROWS( x )


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

the actual code i use is this:

(all of the following are measure)

 

totalCount = CALCULATE(SUM('table'[count]),ALLSELECTED('table'[targetSlicer]))
 
and later on i want to test for percentage of other slicer(individually) out of the targetSlicer
 
TotalPercentage = SUM('table'[count]) / [totalCount]
but i found out totalCount changes whenever i select other slicer. which should not happen

@kmes40505 are you open to share sample data? Your measures have all different columns,



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I've modified the column names. was my bad

 

btw i use table(under visualizations) for other slicers since slicer cannot show multiple values. but for the targetSlicer it is using slicer

Hi @kmes40505

Could you give me an example for better analysis?

it is prefered to provide an example data and expected result and actual result.

 

Best Regards

Maggie

I can't attach an example file here... following is the step to recreate the issue:

 

1. create a data (excel etc) with

targetSlicer otherSlicer     count
choice1       other1            1
choice2       other1            10
choice1       other2            100

2. import data into power bi

3. create "slicer" for targetSlicer

4. create "table" for otherSlicer

5. create measure: 

TotalCount = CALCULATE(SUM(Sheet1[count]),ALLSELECTED(Sheet1[targetSlicer]))
6. create table for TotalCount
7. choose "choice1" in targetSlicer. TotalCount should now show 101
8. click on one of the value in otherSlicer table. you'll see TotalCount value is changed. which should not happened
 
Thank you

@kmes40505 your measure should be

 

TotalCount = CALCULATE(SUM(Sheet1[count]),ALLEXCEPT(Sheet1, Sheet1[targetSlicer]))


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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