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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Aladin66
Frequent Visitor

How to 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
     


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 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

ThxAlot_0-1705357509204.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

3 REPLIES 3
ThxAlot
Super User
Super User

ThxAlot_0-1705357509204.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



This is a good solution, but how can I calculate the number (Count) of similar products? because the measure returns empty value.

Thank you

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors