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

Using Slicer as AND Filter

Hi Everyone,

we have some data set as below.

 

ResponseFeatues

ResponseIDUserID SurveyIdRecordedDate
987xyzabc123 qwerty12 01.01.2020
765fsddef456 qwerty12 01.01.2020
456wqwabc123 dasdas23 02.01.2020

 

AnswerFeatures

ResponseIDUserIDSurveyIdQuestionIDAnswerChoice
987xyzabc123 qwerty12 Q1A
987xyzabc123 qwerty12 Q2A
765fsddef456 qwerty12 Q2C
765fsddef456 qwerty12 Q3D
456wqwabc123 dasdas23 Q1B
456wqwabc123 dasdas23 Q2C
456wqwabc123 dasdas23 Q3A

 

Firstly, I want to see which users submit one more survey when I select this survey on slicer. For example, When I select "qwerty12" and "dasdas23" surveys on the slicer, it show to me UserId "abc123". It must not be only 2 selection, It can be 2 more.

And so I want to see how many users submit selected surveys.

 
1 ACCEPTED SOLUTION

Hi @Anonymous 

 

Just got you, kindly add another measure:

Measure 2 = CALCULATE(COUNTROWS(FILTER(VALUES(AnswerFeatures[UserID]),[Measure]="1")))

 Put it into the card.

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

16 REPLIES 16
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

Kindly let me know if you'd like to get below results:

Capture.PNG

Pbix attached.

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Anonymous
Not applicable

Hi @v-diye-msft ,

 

I've got this error, when I've tried to open this pbix.

 

firatseker_0-1594721647340.png

 

Hi @Anonymous 

 

I just removed the enhanced option, please also make sure you're using the latest desktop version, kindly check this one 🙂

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Anonymous
Not applicable

Hi @v-diye-msft 

 

I still see same problem. I have downloaded it in there : https://www.microsoft.com/en-US/download/details.aspx?id=56723

 

Best,

Hi @Anonymous 

 

Let me explain the details:

Please add the measure:

Measure = var t = CALCULATETABLE(VALUES(AnswerFeatures[SurveyID]),ALL(AnswerFeatures[SurveyID]))
var a = ALLSELECTED(AnswerFeatures[SurveyID])
Return
IF (
        ISBLANK ( COUNTROWS ( EXCEPT ( a, t ) ) ),
        "Yes")

It will filter the "AND" results from the selection of slicer.

1.PNG

There 2 tables connected by response ID. note that you can't use the SurveyId in ResponseFeature to filter the userID in AnswerFeature.

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Anonymous
Not applicable

Hi @v-diye-msft 

 

It seems good but I want to try to see count of userID which submit selected all surveys in Card Visualization, it is not working. Because I can not filter Measure = Yes

 

firatseker_1-1594888208845.png

 

Hi @Anonymous 

 

You can filter the measure is not blank, or change the below as "1", then filter it =1 :

Measure = var t = CALCULATETABLE(VALUES(AnswerFeatures[SurveyID]),ALL(AnswerFeatures[SurveyID]))
var a = ALLSELECTED(AnswerFeatures[SurveyID])
Return
IF (
        ISBLANK ( COUNTROWS ( EXCEPT ( a, t ) ) ),
        "1")

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Anonymous
Not applicable

Hi @v-diye-msft 

 

I can not filter the card visulation by Measure. It doesnt let me to the change filter as you said.

 

firatseker_0-1594891883658.png

 

Hi @Anonymous 

 

Just got you, kindly add another measure:

Measure 2 = CALCULATE(COUNTROWS(FILTER(VALUES(AnswerFeatures[UserID]),[Measure]="1")))

 Put it into the card.

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Anonymous
Not applicable

Hi @v-diye-msft 

 

Thank you. It seems good.

 

Best,

Pragati11
Super User
Super User

Hi @Anonymous ,

 

The simplest way to achieve this is:

  1. Create a Slicer on your report and move SURVEYID to it.
  2. Create a table visual and move USERID column to it.

 

Now try selecting differebt values from your slicer, it should give you required result.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hi @Pragati11,

 

I'm sorry but it is not working. Because If I select one more SurveyID in the slicer, It shows to me users which submit one or more this surveys. But I need users which submit all selected Survey. I need intersection users for this Surveys.

 

Best,

Hi @Anonymous ,

 

Can you kindly put some screesnhots of the visual you tried and what is wrong and what is expected?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hi @Pragati11 

 

When I select SurveyId="qwerty12" it shows to me 4 UserID:

firatseker_0-1594646925626.png

And If I select SurveyID="dasdas23", I see 2 user:

firatseker_2-1594647089889.png

As you can see, When I select both "dasdas23" and "qwerty12",  UserID must be show onlt "abc123" because it is submit both "dasdas23" and "qwerty12". But now I select "dasdas23" and "qwerty12" it shows to me:

firatseker_0-1594647337934.png

 

 

Slicer always works as a "OR" filter, I need "AND" filter

Hi @Anonymous ,

 

First thing slicer doesn't work as an OR, it works as an AND when multiple values are selected.

Second thing, in your previous screesnhot for data tables, I don't see all the users that you have shown in your current screesnhot. 

Am I missing something or you shared data table screesnhots as an example for 2 users only?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hi @Pragati11 ,

 

Yes you can see my sample data table below:

 

ResponseIDUserIDSurveyIDRecordedDateLanguageDurationFinished
987xyzabc123qwerty121.01.2020EN100True
765fsddef456qwerty121.01.2020EN80True
456wqwabc123dasdas232.01.2020AR92True
849sdafds234qwerty122.01.2020AR76False
344kjdgfds23dasdas232.01.2020EN97True
873jhaddsa23ghst5622.01.2020EN75True
927hsgdada23ghst5623.01.2020EN94False
773dad54fsdqwerty123.01.2020EN73True

 

Actually, I need as this solution:

https://medium.com/seismic-data-science/changing-or-to-and-logic-for-power-bi-slicers-1a6b20aee5f5. But it is working very slowly. So I think that I must solve this problem different way.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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