Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
zahirr
Regular Visitor

Product Rank

I have a survey where we asked in the rank of same products as 5 questions -

Rank 1 - A/B/C/D
Rank 2 - A/B/C/D
Rank 3 - A/B/C/D
Rank 4 - A/B/C/D
Any easy way to calculate these options A, B, C, D on the basis of rank weight?

 

 
1 ACCEPTED SOLUTION
rbriga
Impactful Individual
Impactful Individual

Alrright, I see what went wrong.

We need to divide the value by the number of survey IDs:

Weighted Rank =
DIVIDE(
    SUM( 'Survey'[Rank Value] ),
    CALCULATE(
        COUNTROWS(
            VALUES( Survey[_id] )
        ),
        ALL( Survey[Value] )
    )
)

Where "value" is actually the category (food, health, etc.).

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

View solution in original post

4 REPLIES 4
zahirr
Regular Visitor

Yes, it did!
Thanks a lot for the help 🙂 

rbriga
Impactful Individual
Impactful Individual

Assuming you have a column Survey[Rank Value] with the results 1,2,3,4,Sample Table.png

Weighted Rank=
DIVIDE(SUM('Survey'[Rank Value]), COUNTROWS('Survey'))

See the sample table layout that I've assumed you have.

If it's a pivoted table (a column for each rank), unpivot it usinp the query editor.

 

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

Thank you for the suggestions. I already tried reshaping my original data.
Tried your formula as well, which is not working as well.



Original Data -

zahirr_0-1646770855288.png

Reshaped Data-

zahirr_1-1646770978294.png

 

 

rbriga
Impactful Individual
Impactful Individual

Alrright, I see what went wrong.

We need to divide the value by the number of survey IDs:

Weighted Rank =
DIVIDE(
    SUM( 'Survey'[Rank Value] ),
    CALCULATE(
        COUNTROWS(
            VALUES( Survey[_id] )
        ),
        ALL( Survey[Value] )
    )
)

Where "value" is actually the category (food, health, etc.).

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors