web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Filter a PowerBI Repor...
Power Pages
Answered

Filter a PowerBI Report using Logged in Portal User

(0) ShareShare
ReportReport
Posted on by 38

Hi,

 

My requirement is to filter an embedded PowerBI Report using the ID of the logged in user.

 

For example the logged in users contactid is 00b12a73-dfe4-e911-a812-000d3a6aa9c8

I know i can get this using Liquid {{ user.id }}

 

The Embedded PowerBI Report liquid code is as follows

{% powerbi authentication_type:"powerbiembedded"ttps://app.powerbi.com/groups/5a979ca0-8340-4433-a53c-1f4159020084/reports/dbf40511-1b36-44f6-82ca-2f57524b1f4d/ReportSection?filter=cr0f3_Table/cr0f3_employeeid eq '00b12a73-dfe4-e911-a812-000d3a6aa9c8'" %}

 

How can I remove the hardcoded eq '00b12a73-dfe4-e911-a812-000d3a6aa9c8' and replace it with the results from {{ user.id }}?

 

Thanks in advance

Categories:
I have the same question (0)
  • Verified answer
    justinburch Profile Picture
    Microsoft Employee on at

    Hi @AInglis,

    Try setting up the path as a variable if you need to manipulate it.

    {% capture pbiUrl %}https://app.powerbi.com/groups/5a979ca0-8340-4433-a53c-1f4159020084/reports/dbf40511-1b36-44f6-82ca-2f57524b1f4d/ReportSection?filter=cr0f3_Table/cr0f3_employeeid eq '{{ user.id }}'{% endcapture %}
    
    {% powerbi authentication_type:"powerbiembedded" path: pbiUrl %}

    Then you could even extract the URL into a Site Setting and have a different URL for each environment

    {% capture pbiUrl %}{{ settings['Reports/EmployeeTable'] }}/ReportSection?filter=cr0f3_Table/cr0f3_employeeid eq '{{ user.id }}'{% endcapture %}
    
    {% powerbi authentication_type:"powerbiembedded" path: pbiUrl %}

     Where you have a Site Setting with Key of Reports/EmployeeTable and Value of https://app.powerbi.com/groups/5a979ca0-8340-4433-a53c-1f4159020084/reports/dbf40511-1b36-44f6-82ca-2f57524b1f4d

  • AInglis Profile Picture
    38 on at

    Thanks Justin,

    I got this working, however an odd amendment was needed to your code.

     

    When I used pbiURL as the variable Name this error was returned: 

    Liquid syntax error: Syntax Error in 'powerbi' tag. Missing required attribute 'path:[string]'

     

    however when I used pbiURL1 as the variable name it worked.

    It can be replicated i.e pbiEmpUrl doesn't work but pbiEmpUrl1 does.

     

    Any idea why the addition of the number would make a difference?

     

    Thanks

  • justinburch Profile Picture
    Microsoft Employee on at

    That's an odd one, @AInglis. I'm not sure why it doesn't like that, must be some kind of reserved naming for 'url'. To be fair, Liquid templating language is built on Ruby and is very much a 'find & replace' style of language, so there are bound to be some oddities.

    I'll keep this in mind, thanks for sharing and I'm glad you thought to try the number trick!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 47 Super User 2026 Season 1

#2
sannavajjala87 Profile Picture

sannavajjala87 16 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 14 Super User 2026 Season 2

Last 30 days Overall leaderboard