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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.