Skip to main content
cancel
Showing results for 
Search instead 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

Reply
Anonymous
Not applicable

Similitude percentage

Hello,

I need some help.

So i have a table like that:

Aho00_3-1657101159482.png

 

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
v-luwang-msft
Community Support
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:

vluwangmsft_0-1657520929177.png

 

When choose B and C:

vluwangmsft_1-1657520947389.png

 

When choose A and C:

vluwangmsft_2-1657520964941.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
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:

vluwangmsft_0-1657520929177.png

 

When choose B and C:

vluwangmsft_1-1657520947389.png

 

When choose A and C:

vluwangmsft_2-1657520964941.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

Anonymous
Not applicable

Hello, it works!

Thank you.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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