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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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