Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
hi, after many attempts of solving it, I post my request.
I have a table with 2 columns [SupplierID] and [ItemID]. In my dashboard, I would like the user to select one or more items (first item set) from a table visual, get the corresponding set of suppliers' names ("first supplier set"), find all the articles supplied by the suppliers in the "first supplier set" (to determine "a second item set"), and then finally find all the suppliers capable of suppling at least one item of the "second Item set". This is the iteration:
I hope it's clear enough.
many thanks for your help
ffiore
Solved! Go to Solution.
First you'd need to create a helper table with all the distinct values of Item ID. This shouldn't be related to any other tables, you would only use it in the slicer for the user's initial selection.
Then you can create a measure like
Supplier is visible =
VAR CurrentSupplier =
SELECTEDVALUE ( 'Supplier'[Supplier ID] )
VAR SelectedItems =
TREATAS ( VALUES ( 'Helper Items'[Item ID] ), 'Supplier'[Item ID] )
VAR FirstSupplierSet =
CALCULATETABLE ( VALUES ( 'Supplier'[Supplier ID] ), SelectedItems )
VAR SecondItemSet =
CALCULATETABLE (
VALUES ( 'Supplier'[Item ID] ),
REMOVEFILTERS ( 'Supplier' ),
FirstSupplierSet
)
VAR FinalSuppliers =
CALCULATETABLE (
VALUES ( 'Supplier'[Supplier ID] ),
REMOVEFILTERS ( 'Supplier' ),
SecondItemSet
)
VAR Result =
IF ( CurrentSupplier IN FinalSuppliers, 1, 0 )
RETURN
Result
and use this as a visual level filter on a table with columns from the supplier table, set to only show when the value is 1.
it works like a charm!
thank you!!
First you'd need to create a helper table with all the distinct values of Item ID. This shouldn't be related to any other tables, you would only use it in the slicer for the user's initial selection.
Then you can create a measure like
Supplier is visible =
VAR CurrentSupplier =
SELECTEDVALUE ( 'Supplier'[Supplier ID] )
VAR SelectedItems =
TREATAS ( VALUES ( 'Helper Items'[Item ID] ), 'Supplier'[Item ID] )
VAR FirstSupplierSet =
CALCULATETABLE ( VALUES ( 'Supplier'[Supplier ID] ), SelectedItems )
VAR SecondItemSet =
CALCULATETABLE (
VALUES ( 'Supplier'[Item ID] ),
REMOVEFILTERS ( 'Supplier' ),
FirstSupplierSet
)
VAR FinalSuppliers =
CALCULATETABLE (
VALUES ( 'Supplier'[Supplier ID] ),
REMOVEFILTERS ( 'Supplier' ),
SecondItemSet
)
VAR Result =
IF ( CurrentSupplier IN FinalSuppliers, 1, 0 )
RETURN
Result
and use this as a visual level filter on a table with columns from the supplier table, set to only show when the value is 1.
Hi,
I would like the same, but
1. allowing selection of multiple values by the user (e.g. he clicks on 2 or more Item ID's), and
2. FirstSupplierSet has multiple values (e.g. Supplier1, Supplier32, Supplier54...)
this code dosesn't seem to handle this.
thank you
It should work for multiple items as well, unless the requirements are different. The first supplier set would consist of suppliers who supply any of the selected items.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
19 | |
7 | |
6 | |
5 | |
4 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |