Forum Discussion

akj2784's avatar
akj2784
Icon for Post Partisan rankPost Partisan
8 years ago

Filter a column without creating join in Power BI Desktop

I have two tables, one uservendor relationship table and other ProductVendor table.

 

What I want is when I login as a user, Vendor should be defaulted to my own Vendor from Uservendor table.

And the correspondng Product slicer should have list of all products tagged to my Vendor.

However I don't want to create join between these two tables as it will filter out the other vendors data which I dont want.

 

Because along with that I also have one more slicer which should give me list of other vendor's product.

 

So can we have a Product Slicer to show the products of my own vendor in a slicer ? Basically I need to filter a column without creating join.

6 Replies

  • akj2784's avatar
    akj2784
    Icon for Post Partisan rankPost Partisan

    tried Column = LOOKUPVALUE( Column, Search Column, SELECTEDVALUE(Column B))

    but it doesnt work . It shows null in the Column data. It does not through error.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi akj2784,

     

    I'd like to suggest you to create RLS with username function to achieve your requirement.

    RLS with UserName()

     

    Logic:
    1. Username function will return current domain user.
    2. Use above user to get filtered vendors from user table.
    3. Apply filter effect on vendor table .

     

    BTW, it will be help for coding formula if you share some sample data and table structure.

     

    Regards,
    Xiaoxin Sheng

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi akj2784,

         

        After check on your user vendor table, I find your records not support to use username to find specific vendors.

         

        You can try to create a measure to check selected users' vender.

        Check Tag = 
        VAR user =
            SELECTEDVALUE ( UserVendor[User] )
        VAR vendorlist =
            CALCULATETABLE ( VALUES ( UserVendor[Vendor] ), UserVendor[User] = user )
        RETURN
            IF ( SELECTEDVALUE ( 'Product'[Vendor] ) IN vendorlist, 1, 0 )
        

        Result:

         

        Notice: USERNAME fucntion will return current user  name as [email protected](e.g [email protected])

         

         

        Regards,

        Xiaoxin Sheng