Forum Discussion

wildmight2017's avatar
wildmight2017
Advocate II
8 years ago
Solved

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" ))

 

 

 

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! 

3 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    Hi wildmight2017

     

    Try this

     

    Create a small table from the HOME TAB

     

    Now use this MEASURE in newly created table (Table1)

     

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

     

     

      • wildmight2017's avatar
        wildmight2017
        Advocate II

        Thank you