Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ADSL
Post Prodigy
Post Prodigy

Showing Report based on User login and Org. chart

Hi BI Community Team,

 

Currently I have an issue of report display and show when user login and check it. We have 04 levels as the screenshot below, as per expectation want to see report when login like:

 

2024-02-27_13-49-48.png

 

> SalesRep --> able to see their own performance

> Supervisor --> able to see their team (salesrep) only (unable to see another team)

> Manager --> able to see their supervisor only (Not required to see salesrep)

> National Manager --> able to see their manager (Not required to see sales rep)

 

Sample link - https://drive.google.com/drive/folders/1RP_5o9U4FEi325aM2_jncFUEsn07Zw6D?usp=sharing 

 

Any suggestion/advise?

 

Thanks and Regards,

8 REPLIES 8
Anonymous
Not applicable

Hi @ADSL 

Try the following code in RLS

var a=LOOKUPVALUE ( 'SalesRep'[Employee_ID], 'SalesRep'[Email], USERPRINCIPALNAME () )
return CONTAINSSTRING( 'SalesRep'[Path],a)

vxinruzhumsft_2-1709104393728.png

 

2.Then create a new table and hide it.

Table = SUMMARIZE(SalesRep,[Employee_ID])

3.Then create a measure and put it to the visual filter.

MEASURE =
VAR a =
    LOOKUPVALUE ( SalesRep[Pathlength], SalesRep[Email], USERPRINCIPALNAME () )
RETURN
    IF (
        a <> 1
            && COUNTROWS ( ALL ( 'Table' ) ) = COUNTROWS ( ALL ( SalesRep ) ),
        1,
        IF (
            ( a = 3 )
                || ( a = 4 )
                || (
                    a = 1
                        && MAX ( SalesRep[Level 3] ) = BLANK ()
                )
                || (
                    a = 2
                        && MAX ( SalesRep[Level 4] ) = BLANK ()
                ),
            1
        )
    )

vxinruzhumsft_3-1709105460179.png

 

Test it .

vxinruzhumsft_4-1709105503785.png

Output

vxinruzhumsft_5-1709106653999.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

  

Hi @Anonymous,

 

Thank you for helpful feedback. 

 

But it doesn't show any result of these user account sm@demo.com or nsm@demo.com when login as your output screenshot.

Actually it should show the result of Supervisor01, Supervisor02,...etc. 

2024-02-29_09-21-43.png

Any suggestion/advise of this case?

 

Thanks and Regards,

Anonymous
Not applicable

Hi @ADSL 

Actually, when there is no rls applied in the matrix, the value is also blank, you need to check your measure. 

vxinruzhumsft_0-1709174929254.png

vxinruzhumsft_1-1709174947141.png

 

Best Regards!

Yolo Zhu

 

Hi @Anonymous,

 

I'm also a bit challenge of this case. 

 

May I need your support of this measure to apply? 

 

Thanks and Regards,

Anonymous
Not applicable

Hi @ADSL 

I mean that when there is not rls, the [Plan] and [Actural] measures are also blank, you need to check your Plan and actual measures.

 

Best Regards!

Yolo Zhu

 

Hi @Anonymous ,

 

Sorry to bother you again. Could you please assist to show me more detail about it? because I am just learning and not understand so much.

 

Thanks and Regards,

Anonymous
Not applicable

Hi @ADSL 

I don't know the logic of your two measures, I provide a solution to help you implement the user information you need to display, but the displayed values are empty because the measures you wrote yourself cause blanks, you need to check the measures you created yourself, such as your [Actual] and [Plan] measures, these two measures are null in the matrix for some users before I provide the solution.

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

bhelou
Responsive Resident
Responsive Resident

Hello : 

Try to think of a hierarechy  and set a role for each one , then in the service just assign the role for each person . 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors