Forum Discussion
Filter data in table based on silcer
- 4 years ago
Try creating a measure to use as a filter for the visual. You will need an independent table for the slicer selection
Let the independent table values be DSlicer[Value], the fact table be FactTable and the selection column be FactTable[Selection])
Filter measure = SWITCH ( SELECTEDVALUE ( DSlicer[Value] ), "Secure API", COUNTROWS ( CALCULATETABLE ( FactTable, FactTable[Selection] IN { "Devops", "CD" } ) ), "Secure Code", COUNTROWS ( CALCULATETABLE ( FactTable, FactTable[Selection] IN { "Devops", "CD", "Classic" } ) ), "Secure Infrastructure", COUNTROWS ( CALCULATETABLE ( FactTable, FactTable[Selection] IN { "Classic" } ) ) )Select the visual and add this measure as a filter, setting the value to greater or equal to 1
- 4 years ago
Just wanted to say thank you for the above and this seems to have resolved my issue 😀
No idea how you guys do it and have all this knowledge, but the above solution with the measure helped achieve what I wanted, so a big thank you from me!!
Hi Begbie ,
Define a dimension table (dimSlicer) like this:
| slicerValue | codeToInclude |
-----------------------------------
| Secure API | Devops |
| Secure API | CD |
| Secure Code | Devops |
| Secure Code | CD |
| Secure Code | Classic |
| ...
Define a bridge table (codeBridge) that is just a unique list of codes to include:
| codeToInclude |
-------------------
| Devops |
| CD |
| Classic |
| ...
In your data model, relate as follows:
- dimSlicer[codeToInclude] MANY : ONE codeBridge[codeToInclude] (filter direction BOTH)
- codeBridge[codeToInclude] ONE : MANY factTable[Code]
Use dimSlicer[slicerValue] in your page slicer.
Pete
Hi Pete,
Thank you for the pointers and that has seemed to help with the solution, but seems I now have double / triple entries in my table 😣
This is what is being shown when I use the dimSlicer suggestion you gave above:
Whereas before it would show:
I'm sure it's probably down to something silly.
Thanks.
- PaulDBrown4 years agoCommunity Champion
Try creating a measure to use as a filter for the visual. You will need an independent table for the slicer selection
Let the independent table values be DSlicer[Value], the fact table be FactTable and the selection column be FactTable[Selection])
Filter measure = SWITCH ( SELECTEDVALUE ( DSlicer[Value] ), "Secure API", COUNTROWS ( CALCULATETABLE ( FactTable, FactTable[Selection] IN { "Devops", "CD" } ) ), "Secure Code", COUNTROWS ( CALCULATETABLE ( FactTable, FactTable[Selection] IN { "Devops", "CD", "Classic" } ) ), "Secure Infrastructure", COUNTROWS ( CALCULATETABLE ( FactTable, FactTable[Selection] IN { "Classic" } ) ) )Select the visual and add this measure as a filter, setting the value to greater or equal to 1
- Begbie4 years agoHelper I
Just wanted to say thank you for the above and this seems to have resolved my issue 😀
No idea how you guys do it and have all this knowledge, but the above solution with the measure helped achieve what I wanted, so a big thank you from me!!