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
wildmight2017
Advocate II
Advocate II

Dynamic Grade Column - aggregate by (pbix attached) - Measure as filter

 

Good afternoon,

 

I have a data set which assigns grades based on the Salary rank:

Grade is a measure and calculated via 

Grade = IF(HASONEVALUE('Fact Salary'[ANNUAL SALARY]), SWITCH (TRUE(), [Salary Rank]<= [# All Employees]*.33, "A",  [Salary Rank]<= [# All Employees]*.66, "B", [Salary Rank]<= [# All Employees], "C" ))

 

 

1.png

 

I'd like to achieve the following:

 

A) Drop Grade column with # Employees column and get Count by Grade
for the filter above it would be:

Grade# Employees
A3
B3
C4

B) Use Grade in filter (can't do it now since it's a measure) 

 

 

Bining and Banding Pattern does not work here as Rank and Grade are dynamic and depend on # Employees, etc.  The real use case is more complex and could include weighted Rank by categories , departments , etc. 

 

Link to PBIX with mode and data  - https://www.dropbox.com/s/ib33otil2o7ib2b/sample.pbix?dl=0

 

Thank you! 

2 ACCEPTED SOLUTIONS
Zubair_Muhammad
Community Champion
Community Champion

Hi @wildmight2017

 

Try this

 

Create a small table from the HOME TAB

 

smalltable.png

Now use this MEASURE in newly created table (Table1)

 

Measure =
CALCULATE (
    COUNT ( 'Employee Dim'[Name] ),
    FILTER (
        ALL ( 'Employee Dim'[Name] ),
        [Grade] = SELECTEDVALUE ( Table1[Grade] )
    )
)

 

 

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

Hi @wildmight2017

 

Try this

 

Create a small table from the HOME TAB

 

smalltable.png

Now use this MEASURE in newly created table (Table1)

 

Measure =
CALCULATE (
    COUNT ( 'Employee Dim'[Name] ),
    FILTER (
        ALL ( 'Employee Dim'[Name] ),
        [Grade] = SELECTEDVALUE ( Table1[Grade] )
    )
)

 

 

Thank you 

 

 

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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