Forum Discussion
Slicer Options depending on logged in User
Create a table (which will be hidden in the model) with pairs of (ProductID, Username). Username will be the user's email that they connect with, which you can return using a DAX function, probably Username() or something like this. This is the mapping you want to occur. Then connect Products via ProductID to this table with bi-dir filtering. Then put a slicer on the canvas as you would normally do using the column from Products. Then create a measure
[ProductIsOKToShow] = var ProductIsOKToShow_ = NOT ISEMPTY( filter( ProductToUserBridgeTable, ProductToUserBridgeTable[UserName] = USERNAME() ) ) return 1 * ProductIsOKToShow_and filter the slicer via Filter Pane where the condition [ProductIsOKToShow] is 1.
2 Replies
- daxer-almighty
Solution Sage
Create a table (which will be hidden in the model) with pairs of (ProductID, Username). Username will be the user's email that they connect with, which you can return using a DAX function, probably Username() or something like this. This is the mapping you want to occur. Then connect Products via ProductID to this table with bi-dir filtering. Then put a slicer on the canvas as you would normally do using the column from Products. Then create a measure
[ProductIsOKToShow] = var ProductIsOKToShow_ = NOT ISEMPTY( filter( ProductToUserBridgeTable, ProductToUserBridgeTable[UserName] = USERNAME() ) ) return 1 * ProductIsOKToShow_and filter the slicer via Filter Pane where the condition [ProductIsOKToShow] is 1.
- AlexGurovich
Helper II
daxer-almighty Excellent, Kudos. Worked! Fantasic, and thanks for the good help.