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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
MichaelaMul
Helper I
Helper I

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 I
Helper I

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 I
Helper I

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

ManagerGeography
JoeNorth
JoeWest
HarrySouth
HarryEast
MichaelaMul
Helper I
Helper I

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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