Forum Discussion
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
Post 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.
- AnonymousNot applicable
Hi akj2784,
I'd like to suggest you to create RLS with username function to achieve your requirement.
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- akj2784
Post Partisan
I have tried that but it doesnt work.
here is the link with sample dataset.
https://1drv.ms/u/s!AhH0hVVCLnYFaUfcoeKuFMP9QKo
- AnonymousNot 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