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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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