Forum Discussion
Need help with filtering
Hi ignas ,
Follow the steps below:
- Create a table for the answers slicer:
-
Answers = DISTINCT(Survey[Answer])
-
- Create the following measure:
Filter answer =
VAR USERID =
LOOKUPVALUE ( Survey[RecipientID]; Survey[Answer]; VALUES ( Answers[Answer] ) )
RETURN
IF (
DISTINCTCOUNT ( Answers[Answer] )
= CALCULATE ( DISTINCTCOUNT ( Answers[Answer] ); ALL ( Answers ) );
1;
IF ( VALUES ( Survey[RecipientID] ) = USERID; 1; BLANK () )
)
- Place this measure on the table visual filters and set it to is not blank.
Be aware that if the answer is given by more than 1 person this will return an error. If you select all the answers it will return the full table.
Check result attach (file is saved on June version)
Regards,
MFelix
- ignas7 years ago
Advocate II
Hey MFelix
Very nice try, but unfortunately it could not work in any way, because in my real dataset I have over 10mln entries and some of them are repeating. Any other solution with Dax that could work?
I have a solution where I create a separate table from all of these answers and it works just fine, but it consumes space for storing a copy of data in a separate table.
Thanks for helping.
Cheers
Ignas- MFelix7 years ago
Super User
Hi ignas ,
Not aware that you had such a big database, it was not clear on your message.
In my example it is also creating an additional table on the model, because looking at interactions between the visuals if they are from the same table they will filter out the information so you are being a victim of the setup of the data.
If you have a single table and you have a slicer and a chart when you apply filter on the slicer the corresponding visual will have the same filter you cannot dissociate one from the other since they are within the same table.
Regards,
MFelix
- Iamnvt7 years ago
Continued Contributor
hi,
maybe you can create another visual for "ddddd" filter alone, and hide the "ddddd" option from the slicer.
Create this measure:
Measure = CALCULATE(COUNT(Survey[RecipientID]), Survey[Answer] = "ddddd")
to do the visual filter for "ddddd" table.
unlink the visual interaction between slicer and "ddddd" table.
you can check PBI here:
https://1drv.ms/u/s!Aps8poidQa5zk6p365C2AuB5YH8Lxg