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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
austin15g
Regular Visitor

Help with RANK (with COUNTROWS modifier)

Hi all,

I have a Power BI visual for audit executive that is meant to count all of the high-level categories that are mentioned in his conversations with other executives in the business. Taking it a step further, I am looking to rank these categories so most discussed as ranked highest. The counting categories part is simple enough and taken care of. However, when I try to rank them, the ranking is not taking into account external filter context that I have on my report (i.e., filtering based  on which executive the conversation was with). In other words, the ranking is always looking at the source table as a whole, not a filtered-down source table.

 

Below are some screenshots. The first is of the matrix visual filtered on a specific executive. You can see that they only mentioned 3 processes and only once each. However, the ranking is ranking them differently because the categories in the unfiltered base table have different values. The second screenshot is the matrix visual unfiltered where you can see the Integration and Real Estate have lower counts, and what I believe the ranking in screenshot 1 is taking into account. The next two screenshots are of my counting measure and my ranking measure. The last screenshot is a snip of the source data (50 rows in total). Any help would be much appreciated thank you!

 

austin15g_0-1724183607462.png

austin15g_1-1724183670213.png

austin15g_2-1724184064087.png

austin15g_3-1724184699379.png

austin15g_4-1724185588546.png

 

1 ACCEPTED SOLUTION
austin15g
Regular Visitor

For anyone in the future looking at this: I was able to finally get it by using the following RANK measure and setting up my table in the following way. In the table, I just added a column that contained a 1 in every row that was used in the SUM portion of my RANK measure.  I opted to just use a calculated column in the table as opposed to going with a measure that counted the rows since I couldn't figure out how to make that work. As you'll see, I went through a few iterations of the calculated column: The first producing the sum of all Secondary Processes Mentioned in the table (will produce the same value for every line that has the same secondary process). The second being the sum of all Secondary Processes Mentioned for every Executive (Name). The last just being a 1 in every single row. I'm sure there's probably a more proper way of doing this, but this is how I achieved my desired result.

austin15g_1-1724253752446.png
austin15g_0-1724253713159.png

 

View solution in original post

3 REPLIES 3
austin15g
Regular Visitor

For anyone in the future looking at this: I was able to finally get it by using the following RANK measure and setting up my table in the following way. In the table, I just added a column that contained a 1 in every row that was used in the SUM portion of my RANK measure.  I opted to just use a calculated column in the table as opposed to going with a measure that counted the rows since I couldn't figure out how to make that work. As you'll see, I went through a few iterations of the calculated column: The first producing the sum of all Secondary Processes Mentioned in the table (will produce the same value for every line that has the same secondary process). The second being the sum of all Secondary Processes Mentioned for every Executive (Name). The last just being a 1 in every single row. I'm sure there's probably a more proper way of doing this, but this is how I achieved my desired result.

austin15g_1-1724253752446.png
austin15g_0-1724253713159.png

 

amitchandak
Super User
Super User

@austin15g , The Ranking is based on the Number of Mentions, and You are using #Discussion in the visual, are they the same, if not, please add the Number of Mentions in the visual and check the ranking.

Also you can use allselected('Fact Management mentions'[Seconday Process Mensioned])  in place summarize 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit, yes they are the same thing. I just changed the name in the visual for simplicity. I tried your suggestion of simply using ALLSELECTED instead of SUMMARIZE, but still giving everything a rank of 1 for some reason. I'll keep trying at it. Thank you for your suggestion though!

Helpful resources

Announcements
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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