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
MichaelaMul
Helper II
Helper II

Rankx Measure

Hi Everyone,

I made the following measures and would like to Total the Count Measure by Manager but it is not working.

 

Here's the two measures :

 

 

Measure 1:
Brands Vol Sales minus Category Vol Sales = 
SUM('NB Share'[Brands Vol Sales]) - SUM('NB Share'[Category Vol Sales])

Measure 2:
# of Accts growing faster = COUNTX
(
FILTER
(
VALUES
( 'NB Share'[Geography]),
[Brands Vol Sales minus Category Vol Sales]
>
0),'NB Share'[Geography])

 

 

 

6 REPLIES 6
MichaelaMul
Helper II
Helper II

Hi! I am trying now to make a matrix table like the one below and rank the following brands by their volume sales in their category, but the ranking isn't working. I would want to filter by geography, time, and select the brands I would like to see (as you can see in the screenshot). Also it is using the same sample data I provided last time, except the Red Apple and Purple Grape = Our Brands.

For example, the Our Brand Apple I would like the ranking to be #1, since compared to the Green Apple they have higher volume sales.

MichaelaMul_0-1715789739167.png

 

sevenhills
Super User
Super User

Assuming your measure 1 is doing calc correctly, try this and see if works

Measure 2:
# of Accts growing faster = 
var _m1Value = CALCULATE ( [Brands Vol Sales minus Category Vol Sales])

RETURN COUNTAX(   
       -- For all the values in the Geography
       VALUES(Table1['NB Share'[Geography]), 
       -- Check if the value is > 0, then 1 else dont count
       if( _m1Value > 0, 1, BLANK() )
)

  

Thank you for the reply! That didn't work but what I ended up doing was make Measure 2 a calculated column, and then did a COUNTROWS measure and that worked. 

The code I provided is for measure and interesting why it did not work. 

 

No worries, you got working as a calculated column. 🙂

MichaelaMul
Helper II
Helper II

and then the manager sample table is below, it is connected on Geography of the other table

ManagerGeography
JoeNorth
JoeWest
HarrySouth
HarryEast
MichaelaMul
Helper II
Helper II

Sample data below: In red are the two measure I made and in blue is what I would like.

GeographyTimeProductCategoryEntire Category%Vol Sales ChangeBrands Vol SalesCategory Vol SalesDifference between Brand and OverallCount if more than 0TOTAL
NorthLast 4 WeeksGroup Apple Apple10% 10%  2
NorthLast 4 WeeksProduct Red AppleApple 12%12% 2%1
NorthLast 4 WeeksProduct Green AppleApple 15%    
NorthLast 4 WeeksGroup Grape Grape20% 20%  
NorthLast 4 WeeksProduct Purple GrapeGrape 22%22% 2%1
NorthLast 4 WeeksProduct Green GrapeGrape 18%    
NorthLast 13 WeeksGroup Apple Apple15% 15%  2
NorthLast 13 WeeksProduct Red AppleApple 18%18% 31
NorthLast 13 WeeksProduct Green AppleApple 13%    
NorthLast 13 WeeksGroup Grape Grape21% 21%  
NorthLast 13 WeeksProduct Purple GrapeGrape 24%24% 31
NorthLast 13 WeeksProduct Green GrapeGrape 19%    
SouthLast 4 WeeksGroup Apple Apple8% 8%   
SouthLast 4 WeeksProduct Red AppleApple 5%5% -3 
SouthLast 4 WeeksProduct Green AppleApple 12%    
SouthLast 4 WeeksGroup Grape Grape18% 18%  
SouthLast 4 WeeksProduct Purple GrapeGrape 26%26% -8% 
SouthLast 4 WeeksProduct Green GrapeGrape 20%    
SouthLast 13 WeeksGroup Apple Apple15% 15%  2
SouthLast 13 WeeksProduct Red AppleApple 16%16% 1%1
SouthLast 13 WeeksProduct Green AppleApple 11%    
SouthLast 13 WeeksGroup Grape Grape25% 25%  
SouthLast 13 WeeksProduct Purple GrapeGrape 26%26% 1%1
SouthLast 13 WeeksProduct Green GrapeGrape 17%    
WestLast 4 WeeksGroup Apple Apple26% 26%  2
WestLast 4 WeeksProduct Red AppleApple 27%27% 1%1
WestLast 4 WeeksProduct Green AppleApple 22%    
WestLast 4 WeeksGroup Grape Grape13% 13%  
WestLast 4 WeeksProduct Purple GrapeGrape 16%16% 3%1
WestLast 4 WeeksProduct Green GrapeGrape 19%    
WestLast 13 WeeksGroup Apple Apple14% 14%  1
WestLast 13 WeeksProduct Red AppleApple 18%18% 4%1
WestLast 13 WeeksProduct Green AppleApple 11%    
WestLast 13 WeeksGroup Grape Grape25% 25%  
WestLast 13 WeeksProduct Purple GrapeGrape 21%21% -4% 
WestLast 13 WeeksProduct Green GrapeGrape 26%    
EastLast 4 WeeksGroup Apple Apple12% 12%   
EastLast 4 WeeksProduct Red AppleApple 10%10% -2% 
EastLast 4 WeeksProduct Green AppleApple 18%    
EastLast 4 WeeksGroup Grape Grape25% 25%  
EastLast 4 WeeksProduct Purple GrapeGrape 21%21% -4% 
EastLast 4 WeeksProduct Green GrapeGrape 13%    
EastLast 13 WeeksGroup Apple Apple19% 19%   
EastLast 13 WeeksProduct Red AppleApple 14%14% -5% 
EastLast 13 WeeksProduct Green AppleApple 9%    
EastLast 13 WeeksGroup Grape Grape22% 22%  
EastLast 13 WeeksProduct Purple GrapeGrape 29%29% -7% 
EastLast 13 WeeksProduct Green GrapeGrape 22%    

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.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

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.