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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
Aladin66
Frequent Visitor

How Select Product and show similar products based on multiple Criteria?

I have a dashboard I want to create where a user selects (from a drop down slicer) a Product then from Criteria Color and Size ..... then a table next to the slicer returns "similar" products.


Example1: User selects slicerProduct: B (which is color red and size 2) then selects slicerCriteria: Color and Size. Table next to the slicer returns all Products that are red and also size 2 ---------> (B and E)


Example2: User selects slicerProduct: A (which is color green and size 1 and Cost 1000) then selects slicerCriteria: Color, Size and Cost. Table next to the slicer returns all Products that are green and also size 1 and Cost 1000 ---------> (A, C and F)

Example3 User selects slicerProduct: A (which is color green and size 1 and Cost 1000.....) then selects slicerCriteria: Color, Size, Cost and Marked. Table next to the slicer returns all Products that are green and also size 1 and Cost 1000 and Marked Alex ---------> (A, and F)

 

DataTable:

ProductColorSizeCostMarked
AGreen11000Alex
BRed24000Martin
CGreen11000Martin
DBlue52000Sam
ERed24000Laura
FGreen11000Alex
GGreen511000Caro
GGreen511000Caro



I have tried to write this measure:

 

 

 

similarProduct =
var _colors=CALCULATETABLE(VALUES('DataTable'[Color]),FILTER(ALLSELECTED('DataTable'),'DataTable'[Product]=SELECTEDVALUE('slicerProduct'[Product])))
var _size=CALCULATETABLE(VALUES('DataTable'[Size]),FILTER(ALLSELECTED('DataTable'),'DataTable'[Product]=SELECTEDVALUE('slicerProduct'[Product])))
var _cost=CALCULATETABLE(VALUES('DataTable'[Cost]),FILTER(ALLSELECTED('DataTable'),'DataTable'[Product]=SELECTEDVALUE('slic rProduct'[Product])))
var _marked=CALCULATETABLE(VALUES('DataTable'[Marked]),FILTER(ALLSELECTED('DataTable'),'DataTable'[Product]=SELECTEDVALUE('slicerProduct'[Product])))
return
CALCULATE(MAX('DataTable'[Product]),FILTER('DataTable', 'DataTable'[Color] in _colors &&
                                                        'DataTable'[Size] in _size &&
                                                        'DataTable'[Cost] in _cost &&
                                                        'DataTable'[Marked] in _marked
))

 

 

 

 

but it works partially, how can I extend my measure so that also I can use slicerCriteria with slicetProduct to get similar Products.

Aladin66_0-1705310263389.png

slicerCriteria:

Criteria
Color
Size
Cost
Marked

 

slicerProduct:

Product
A
B
C
D
E
F
G
1 REPLY 1
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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