Forum Discussion
Combine distinct with lookup
- Anonymous1 year ago
Hi diablo9082 ,
Thanks for reaching out to the Microsoft fabric community forum.
You can create the table using LOOKUPVALUE, which is especially safe in DirectQuery and doesn’t depend on relationship direction. Here’s the DAX:VendorTable =
ADDCOLUMNS (
DISTINCT ( Payment[Vendor] ),
"Vendor_Name",
LOOKUPVALUE (
VendorMast[Vendor_Name],
VendorMast[Vendor], Payment[Vendor]
)
)This will return only the vendors that appear in the Payment table, along with their names from VendorMast. You can then use this new table in slicers.
I’ve attached a sample .pbix to demonstrate the setup, feel free to test or build on top of it!
Please find the attached pbix file for your reference.
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Best Regards,
Tejaswi.
Community Support
Hi diablo9082 ,
Thanks for reaching out to the Microsoft fabric community forum.
You can create the table using LOOKUPVALUE, which is especially safe in DirectQuery and doesn’t depend on relationship direction. Here’s the DAX:
VendorTable =
ADDCOLUMNS (
DISTINCT ( Payment[Vendor] ),
"Vendor_Name",
LOOKUPVALUE (
VendorMast[Vendor_Name],
VendorMast[Vendor], Payment[Vendor]
)
)
This will return only the vendors that appear in the Payment table, along with their names from VendorMast. You can then use this new table in slicers.
I’ve attached a sample .pbix to demonstrate the setup, feel free to test or build on top of it!
Please find the attached pbix file for your reference.
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Best Regards,
Tejaswi.
Community Support
This worked phenomenally. Thanks!