Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Correlation in Product Structure

Hello there,   I'm working on a model where I could look at the similarity between products through the product structure.   The product structure looks like this: TopProduct ComponentPart ...
  • Greg_Deckler's avatar
    6 years ago

    Anonymous - I did it like this:

    Measure 2 = 
        VAR __T = MAX('Table (4)'[TopProduct])
        VAR __T1 = MAX('Table 2'[TopProduct])
        VAR __Parts = SELECTCOLUMNS(FILTER(ALL('Table (4)'),[TopProduct] = __T),"__Parts",[ComponentPart])
        VAR __Parts1 = SELECTCOLUMNS(FILTER(ALL('Table (4)'),[TopProduct] = __T1),"__Parts",[ComponentPart])
        VAR __In = INTERSECT(__Parts,__Parts1)
    RETURN
        COUNTROWS(__In) / COUNTROWS(__Parts)

    PBIX is attached below sig, you want Table (4) and Table 2.