Forum Discussion
Hide Visuals for Specific Users or Group
- Anonymous1 year ago
Hi powerbiexpert22 ,
Thank you for the follow-up,I would be happy to assist you!- Create 3 measures for each visual .
ShowBarChart =
IF(
MAX(SalesData[Department]) = "Finance",
1,
0
)ShowLineChart =
IF(
MAX(SalesData[Department]) = "Marketing",
1,
0
)ShowPieChart =
IF(
MAX(SalesData[Department]) = "Finance",
1,
0
) - To control the visibility of visuals based on user roles, add the desired chart type to your report (such as a bar chart, line chart, or pie chart), then navigate to the filter pane for that visual and apply the corresponding visibility filter: for a Bar Chart, set the filter ShowBarChart = 1; for a Line Chart, use ShowLineChart = 1; and for a Pie Chart, apply ShowPieChart = 1. This ensures that each visual is only displayed when the corresponding condition is met.Refer the screenshot:
-
Create an RLS rule on UserAccess:
[UserName] = USERPRINCIPALNAME()
- Refer the screenshots below:
ā
ā
- Please refer the attached file.
I hope this answer resolve your query.If so,give us kudos and consider accepting it as solution.
Regards,
Pallavi. - Create 3 measures for each visual .
Hi Akash_Varuna ,
i created filter ShowVisual which has defult value 1 and assign to all charts, please see attached pbix for reference , what should be the next step? which permission table i have to create?
https://drive.google.com/file/d/1TXJ5-35sfsbFAYBj6Ey-Os0AOG0ZnOUz/view?usp=drive_link
- Anonymous1 year agoNot applicable
Hi powerbiexpert22 ,
Thank you Akash_Varuna for the helpful response!
Create a new measure using the below DAX :
ShowVisualAccess =
VAR CurrentUser = USERNAME()
RETURN
CALCULATE(
MAX(yourtable[ShowVisual]),
FILTER(yourtable, yourtable[UserRole] = CurrentUser)
)
Drag the ShowVisualAccess measure into the Filters on this visual pane. Set the filter to "is 1".
Hope this resolve your query.if so,consider accepting it as solution.
Thank you.
Regards,
Pallavi.