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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
mbmcdonald2
Helper II
Helper II

Adding Ranks?

Hi All,

I'm wondering if someone could help me with the following: I have two separate ranks I've done for 2 separate measures and I would like to be able to add up these ranking numbers to create sort of a "score" to combine these two measures. As you can see in the screenshot below, each zone is receiving a score of 2 (where East should have a score of 4, Central a score of 3, and West a score of 5). 

 

Do you know if it is possible to achieve this? 

 

Here is my current calculation: 

Consumer Preference Score = [Industry Per Caps Rank]+[Observed Drinker Rank]
 
Thank you in advance!
 
mbmcdonald2_0-1730902133451.png

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @mbmcdonald2 
Allways use a common dimention. Attached sample file with the proposed solution.

1.png2.png

View solution in original post

13 REPLIES 13
tamerj1
Super User
Super User

Hi @mbmcdonald2 
Allways use a common dimention. Attached sample file with the proposed solution.

1.png2.png

This worked! Thank you so much!!

SachinNandanwar
Super User
Super User

Only way I can see this can solved is by combing both the two tables , with the columns "observered drink" and "Industry Per caps" and then setting up field parameters on this new table.



Regards,
Sachin
Check out my Blog
v-denglli-msft
Community Support
Community Support

Thanks for the reply from bhanu_gautam, johnt75 and SachinNandanwar, please allow me to provide another insight.
Hi @mbmcdonald2 ,


I am not sure how your dataset is designed, below is my sample.

The Industry per Caps Rank table.

vdengllimsft_0-1731042945679.png


The Selection Parameter table.

vdengllimsft_1-1731042975445.png


Add the two ranks together using the following measure.

 

VAR _tb1 =SUMMARIZECOLUMNS('Industry per Caps Rank'[Zone],"A",[Observed Drinkers Rank])
VAR _tb2 =SUMMARIZECOLUMNS('Industry per Caps Rank'[Zone],"B",[Industry Per Caps Rank])
VAR _tb3 =
ADDCOLUMNS(
    _tb1,"C",[A]+SUMX(FILTER(_tb2,[Zone] = EARLIER('Industry per Caps Rank'[Zone])),[B])
)
   RETURN
    SUMX(_tb3,[C])

 


The final result is as follows, hopefully it will meet your needs.

vdengllimsft_2-1731043106965.png


If the above solutions do not solve the problem, please provide a sample PBIX file for us to understand the problem better and help you.

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Please see the attached pbix for reference.

Best Regards,
Dengliang Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi @v-denglli-msft and @SachinNandanwar thank you so much for all of the help. Please find my sample upload here for further context. Any assistance is greatly appreciated!

The file is inaccessible.



Regards,
Sachin
Check out my Blog

Hi Sachin! So sorry about that. Please try now!

mbmcdonald2
Helper II
Helper II

Hello @SachinNandanwar I created a new forum for my follow up question to this inquiry - do you think you would be able to help me here? Essentially I would like to add two ranks together, both of which are calculated using parameters. Any assistance would be greatly appreciated.

 

Thank you very much in advance!

Can you share the PBI file ?



Regards,
Sachin
Check out my Blog
johnt75
Super User
Super User

What are the definitions of the other measures ?

Hi there, thank you so much for your response. So it's a bit tricky because these ranks are built with parameters. See below. 

 

Industry Per Caps Rank =
VAR OverallRank =
    RANKX(
        ALLSELECTED ('Industry per Caps Rank'),
        CALCULATE (SUM ('Industry per Caps Rank'[Industry Per Caps])),
        ,
        DESC,Dense)
VAR SubCategoryRank =
    RANKX (
        ALLSELECTED ('Industry per Caps Rank'[Sub-Category]),
        CALCULATE (sum('Industry per Caps Rank'[Industry Per Caps])),
        ,
        DESC,
        Dense
)
VAR ZoneRank =
        RANKX (
            ALLSELECTED ('Industry per Caps Rank'[Zone]),
            CALCULATE (SUM ('Industry per Caps Rank'[Industry Per Caps])),
            ,
            DESC,
            Dense
            )
VAR ChannelRank =
    RANKX (
        ALLSELECTED ('Industry per Caps Rank'[Channel]),
        CALCULATE (SUM('Industry per Caps Rank'[Industry Per Caps])),
        ,
        DESC,
        Dense
        )
VAR ManufacturerRank =
    RANKX (
        ALLSELECTED ('Industry per Caps Rank'[Manufacturer]),
        CALCULATE(SUM ('Industry per Caps Rank'[Industry Per Caps])),
        ,
        DESC,
        DENSE
        )
VAR CategoryRank =
    RANKX (
        ALLSELECTED ('Industry per Caps Rank'[Category]),
        CALCULATE(SUM ('Industry per Caps Rank'[Industry Per Caps])),
        ,
        DESC,
        DENSE
        )
RETURN
    SWITCH (
        TRUE (),
         CONTAINSSTRING ( SELECTEDVALUE ('Selection Parameter'[Type]), "Channel" ) , ChannelRank,
         CONTAINSSTRING ( SELECTEDVALUE ('Selection Parameter'[Type]), "Zone" ), ZoneRank,
         CONTAINSSTRING (SELECTEDVALUE ( 'Selection Parameter'[Type]), "Sub"), SubCategoryRank,
         CONTAINSSTRING (SELECTEDVALUE ( 'Selection Parameter'[Type]), "Category"), CategoryRank,
         CONTAINSSTRING (SELECTEDVALUE ('Selection Parameter'[Type]), "Manufacturer"), ManufacturerRank,
         OverallRank
    )
bhanu_gautam
Super User
Super User

@mbmcdonald2 , Try using

Ensure that you have calculated the ranks for both measures correctly. You can use the RANKX function in Power BI to rank your measures.

Industry Per Caps Rank = RANKX(ALL('Table'), 'Table'[Industry Per Caps], , ASC, Dense)
Observed Drinker Rank = RANKX(ALL('Table'), 'Table'[Observed Drinker], , ASC, Dense)


Create the Combined Score: Once you have the ranks, you can create a new measure to sum these ranks.
Consumer Preference Score = [Industry Per Caps Rank] + [Observed Drinker Rank]


Visualize the Combined Score: Add the Consumer Preference Score measure to your visual to see the combined score for each zone.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Hi there, thank you so much for your response. So it's a bit tricky because these ranks are built with parameters. See below. 

 

Industry Per Caps Rank =
VAR OverallRank =
    RANKX(
        ALLSELECTED ('Industry per Caps Rank'),
        CALCULATE (SUM ('Industry per Caps Rank'[Industry Per Caps])),
        ,
        DESC,Dense)
VAR SubCategoryRank =
    RANKX (
        ALLSELECTED ('Industry per Caps Rank'[Sub-Category]),
        CALCULATE (sum('Industry per Caps Rank'[Industry Per Caps])),
        ,
        DESC,
        Dense
)
VAR ZoneRank =
        RANKX (
            ALLSELECTED ('Industry per Caps Rank'[Zone]),
            CALCULATE (SUM ('Industry per Caps Rank'[Industry Per Caps])),
            ,
            DESC,
            Dense
            )
VAR ChannelRank =
    RANKX (
        ALLSELECTED ('Industry per Caps Rank'[Channel]),
        CALCULATE (SUM('Industry per Caps Rank'[Industry Per Caps])),
        ,
        DESC,
        Dense
        )
VAR ManufacturerRank =
    RANKX (
        ALLSELECTED ('Industry per Caps Rank'[Manufacturer]),
        CALCULATE(SUM ('Industry per Caps Rank'[Industry Per Caps])),
        ,
        DESC,
        DENSE
        )
VAR CategoryRank =
    RANKX (
        ALLSELECTED ('Industry per Caps Rank'[Category]),
        CALCULATE(SUM ('Industry per Caps Rank'[Industry Per Caps])),
        ,
        DESC,
        DENSE
        )
RETURN
    SWITCH (
        TRUE (),
         CONTAINSSTRING ( SELECTEDVALUE ('Selection Parameter'[Type]), "Channel" ) , ChannelRank,
         CONTAINSSTRING ( SELECTEDVALUE ('Selection Parameter'[Type]), "Zone" ), ZoneRank,
         CONTAINSSTRING (SELECTEDVALUE ( 'Selection Parameter'[Type]), "Sub"), SubCategoryRank,
         CONTAINSSTRING (SELECTEDVALUE ( 'Selection Parameter'[Type]), "Category"), CategoryRank,
         CONTAINSSTRING (SELECTEDVALUE ('Selection Parameter'[Type]), "Manufacturer"), ManufacturerRank,
         OverallRank
    )

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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