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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
austin15g
Regular Visitor

Ranking of text column by count of instances - works for test table, but not for measure

Hello all,

 

I am trying to create a measure that ranks by the number of instances a text field appears in a table. For reference, the table is a simple table for a single line for every conversation with a business executive and the process that was discussed. I am trying to count each instance of the process that was discussed and rank them from most important to least (highest to lowest). Below is a snip of the main table (FYI I had to create a calculated column to count the instances of each process because I couldn't figure out how to build that into the measure).

austin15g_2-1721229986642.png

 

I am able to get the result that I want when I test it by creating a blank table, but when it comes to putting it in a measure and in a matrix visual, the rank value appears as 1s for every single row and I can't seem to figure out why. Here is the DAX code of the test table I created and a snip of the output.

 

test = 
ADDCOLUMNS (
    SUMMARIZE (
        'FACT Mgmt Convos',
        'FACT Mgmt Convos'[Secondary Processes Mentioned],
        'FACT Mgmt Convos'[Count of Process]
    ),
    "Rank",
        RANK (
            DENSE,
            SUMMARIZE (
                'FACT Mgmt Convos',
                'FACT Mgmt Convos'[Secondary Processes Mentioned],
                'FACT Mgmt Convos'[Count of Process]
            ),
            ORDERBY ( 'FACT Mgmt Convos'[Count of Process], DESC )
        )
)

 

austin15g_0-1721229637309.png

As you can see, the Rank column works just fine. Below is my DAX code for the measure which is pretty much the same exact thing. 

 

 

Mgmt Mentions Ranking = 
RANK (
    DENSE,
    SUMMARIZE (
            'FACT Mgmt Convos',
            'FACT Mgmt Convos'[Secondary Processes Mentioned],
            'FACT Mgmt Convos'[Count of Process]
        ),
    ORDERBY ( 'FACT Mgmt Convos'[Count of Process], DESC )
    )

 

And here is a snip of the matrix visual.

austin15g_1-1721229862597.png

 

Any guidance on why each row is populating with a rank of 1?

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please try something like below whether it suits your requirement.

 

Mgmt Mentions Ranking =
RANK (
    DENSE,
    SUMMARIZE (
        ALLSELECTED ( 'FACT Mgmt Convos' ),
        'FACT Mgmt Convos'[Secondary Processes Mentioned],
        'FACT Mgmt Convos'[Count of Process]
    ),
    ORDERBY ( 'FACT Mgmt Convos'[Count of Process], DESC )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

Please try something like below whether it suits your requirement.

 

Mgmt Mentions Ranking =
RANK (
    DENSE,
    SUMMARIZE (
        ALLSELECTED ( 'FACT Mgmt Convos' ),
        'FACT Mgmt Convos'[Secondary Processes Mentioned],
        'FACT Mgmt Convos'[Count of Process]
    ),
    ORDERBY ( 'FACT Mgmt Convos'[Count of Process], DESC )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

I was trying to toy around with ALLSELECTED but clearly wasn't putting it in the right position or something. Thank you so much, it worked perfectly!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.