cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Anonymous
Not applicable

## Similitude percentage

Hello,

I need some help.

So i have a table like that:

I want in power bi to compare two sites and find the % of similitude between them for all the product

So for each site, i want to compare each product (if they are the same or not)

For example if i compare Site A and Site B :

The result should be 100% because for each product (1, 2 and 3) all the criterias (X,Y, Z) perfectly match

Bur for a comparison between Site A and Site C

The result should be 33,33% because for the product 3 it perfectly match but for the product 1 and 2 there is atleast 1 difference each time for the criterias

So how can i do that?

With also 2 different slicers :

First one to choose the first site

Second one to choose the second site (for a comparison)

Thank you.

1 ACCEPTED SOLUTION
Community Support

HI @Anonymous ,

Pls test to create the below measure:

``````TEST = IF(
CALCULATE (
COUNTROWS('Table'),
ALLSELECTED ( 'Table' ),
'Table'[Product] = MAX ( 'Table'[Product] )
&& 'Table'[CriteriaX] = MAX ( 'Table'[CriteriaX] )
&& 'Table'[CriteriaY] = MAX ( 'Table'[CriteriaY] )
&& 'Table'[CriteriaZ] = MAX ( 'Table'[CriteriaZ] )
)=2,1,0)``````
``TEST2 = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[TEST]=1))/COUNTROWS('Table')``

Output result:

When choose A and  B:

When choose B and C:

When choose A and C:

Best Regards

Lucien

2 REPLIES 2
Community Support

HI @Anonymous ,

Pls test to create the below measure:

``````TEST = IF(
CALCULATE (
COUNTROWS('Table'),
ALLSELECTED ( 'Table' ),
'Table'[Product] = MAX ( 'Table'[Product] )
&& 'Table'[CriteriaX] = MAX ( 'Table'[CriteriaX] )
&& 'Table'[CriteriaY] = MAX ( 'Table'[CriteriaY] )
&& 'Table'[CriteriaZ] = MAX ( 'Table'[CriteriaZ] )
)=2,1,0)``````
``TEST2 = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[TEST]=1))/COUNTROWS('Table')``

Output result:

When choose A and  B:

When choose B and C:

When choose A and C:

Best Regards

Lucien

Anonymous
Not applicable

Hello, it works!

Thank you.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.