Forum Discussion
Calcule similarity between two item
- 6 years ago
Hi Anonymous
Sorry for the late reply.
Add a measure
Measure = VAR left = CONCATENATEX ( VALUES ( 'left slicer' ), 'left slicer'[SAMU], "," ) VAR right = CONCATENATEX ( VALUES ( 'right slicer' ), 'right slicer'[SAMU], "," ) RETURN IF ( FIND ( MAX ( [SAMU] ), left, 1, 0 ) || FIND ( MAX ( [SAMU] ), right, 1, 0 ), 1, 0 )then modify a measure as below
percent = VAR P = CALCULATE ( DISTINCTCOUNT ( 'Table'[FEATURE] ), FILTER ( 'Table', [similarity1] = 1 && [Measure] = 1 ) ) / CALCULATE ( DISTINCTCOUNT ( 'Table'[FEATURE] ), FILTER ( ALLSELECTED ( 'Table' ), [Measure] = 1 ) ) RETURN IF ( ISBLANK ( P ), 0, P )Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Maggi !
Thanks for you amazing job !!!!!!
Itis realy near to be functonial !!
Indeed, it works with a dataset with only 2 SAMU, but when i do it with my real dataset (which contains 100 SAMU), the percentage screened is wrong.
I think it's because he counts in the total of similarity with SAMU which are not chosen in the slicers.
Let's have a look :
I guess he counts in the total of similarity the number for all SAMU, even if they are not chosen in the slicers.
That's why the percentage screened is always > 90%.
I dont have the skills to correct the measure you wrote, this is too much complicated for me ...
I don't know how to attach a document (the .pix) with my post to give you the full dataset ...
EDIT : I think the answer shoud be to modify only the percentage measure to count in the first total only the SAMU chosen in the slicer .. but don't know how to do that !
Hi Anonymous
Add some data to your original data example(you could paste here), and share me the expected result for the example.
Best Regards
Maggie
- Anonymous6 years agoNot applicable
Hey Maggie,
i hope you're good today.
So here is a better view of my dataset :
And here is the number i want, dpeending on what SAMU i chose in the left and right slicers.
thanks !
- Anonymous6 years agoNot applicable
Hi everybody ?
Does someone can help me ? 😞
Thank you
- v-juanli-msft6 years ago
Community Support
Hi Anonymous
Sorry for the late reply.
Add a measure
Measure = VAR left = CONCATENATEX ( VALUES ( 'left slicer' ), 'left slicer'[SAMU], "," ) VAR right = CONCATENATEX ( VALUES ( 'right slicer' ), 'right slicer'[SAMU], "," ) RETURN IF ( FIND ( MAX ( [SAMU] ), left, 1, 0 ) || FIND ( MAX ( [SAMU] ), right, 1, 0 ), 1, 0 )then modify a measure as below
percent = VAR P = CALCULATE ( DISTINCTCOUNT ( 'Table'[FEATURE] ), FILTER ( 'Table', [similarity1] = 1 && [Measure] = 1 ) ) / CALCULATE ( DISTINCTCOUNT ( 'Table'[FEATURE] ), FILTER ( ALLSELECTED ( 'Table' ), [Measure] = 1 ) ) RETURN IF ( ISBLANK ( P ), 0, P )Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.