The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
|
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.
slicerCriteria:
Criteria
|
slicerProduct:
Product
|
Solved! Go to Solution.
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
User | Count |
---|---|
78 | |
74 | |
43 | |
32 | |
28 |
User | Count |
---|---|
104 | |
93 | |
51 | |
51 | |
46 |