Forum Discussion
Anonymous
1 year agoNot applicable
Make a slicer with AND function
Hello all, For my report I need the user to be able to filter everything that is ONLY requested. So an AND function rather then an OR function. I will provide sample data below: CustomerTbl ...
- 1 year ago
Hi Anonymous ,
Here is the file you asked.
Kedar_Pande
Super User
1 year agoEnsure that your tables (CustomerTbl, ActionTbl, AmountTbl) are properly related through the ID column
DAX Measure:
SelectedOnlyMeasure =
VAR SelectedAreas = VALUES('ActionTbl'[Area]) // Get selected areas
VAR UniqueCount = DISTINCTCOUNT('ActionTbl'[Area]) // Count unique areas for the ID
VAR FilteredIDs =
CALCULATETABLE(
VALUES('ActionTbl'[ID]), // Get IDs based on the selected areas
FILTER(
'ActionTbl',
'ActionTbl'[Area] IN SelectedAreas
)
)
VAR MatchCount =
COUNTROWS(
FILTER(
'ActionTbl',
'ActionTbl'[ID] IN FilteredIDs // Only check the filtered IDs
)
)
RETURN
IF(
MatchCount = UniqueCount, // Check if count matches unique count
1, // Return 1 if they match
0 // Return 0 if they don't match
)
Set the visual filter to show items where SelectedOnlyMeasure is equal to 1.
💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
- Anonymous1 year agoNot applicable
Thank you! However this measure doe not make it happen so that the visual only displays the value where the selection is set to. If there are more area's and only one is selected it still shows that as the answer..