Forum Discussion
Report URL with Parameters in Teams notification
Hi LP280388
Here's an idea for your reference:
First of all, create roles in Power BI Desktop that define the filtering logic. For example:
[EmpID] = IF(
ISFILTERED('YourTable'[EmpID]) && SELECTEDVALUE('YourTable'[EmpID]) <> BLANK(),
SELECTEDVALUE('YourTable'[EmpID]),
USERPRINCIPALNAME()
)
Then set up url parameters, and ensure that the URLs sent in Teams notifications include the necessary parameters to filter the data. For example:
app.powerbi.com/groups/.../datasets/.../ReportSection?filter=YourTable/EmpID eq 'PARAM_EMP_ID'
Next, handle filtering in Power BI, use DAX to detect whether a URL parameter is present. You can create a calculated column or measure to check if the EmpID filter is applied.
FilteredEmpID =
IF(
ISFILTERED('YourTable'[EmpID]),
SELECTEDVALUE('YourTable'[EmpID]),
USERPRINCIPALNAME()
)
When setting up the Teams notification, ensure the URL includes the filter parameter if you want to filter for another user. If no parameter is included, the RLS will apply and filter for the logged-in user.
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous , I get the error that userprinciple cant be used in calculated column for the below. If i create a measure, im unable to use it in the "Filter all page". Is there any other way ?
Since i have multiple visuals in the canvas and multiple pages of same showing other info of the same employee, I have to apply this filter at "Filter on all pages"
FilteredEmpID =
IF(
ISFILTERED('YourTable'[EmpID]),
SELECTEDVALUE('YourTable'[EmpID]),
USERPRINCIPALNAME()
)Thanks for your reply.