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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
kipi_bi
Frequent Visitor

Problem with MAXX

Hello Team,

 

I am trying to get the Maximum Score achieved by any Employee but it is getting filtered at employee level ,even after applying additional filters with ALL and REMOVEFILTER, there is 1 to many relationship frmo Dim_Employee TO Fact_employee_training

 

 

kipi_bi_1-1761655286740.png

Fact Table: 

  • EmployeeID,ProgramID,SkillID,CertificationID,CompletionDate,Score

     

     

    Dim_Table

    EmployeeID,FullName,Department,Location,JoiningDate,SkillName

 

Regards,

Ritz.

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

pls try

MaxTotalScorePerEmployee =
CALCULATE(
    MAXX(
        ADDCOLUMNS(
            SUMMARIZE(
                ALL(Dim_Employee),
                Dim_Employee[EmployeeID]
            ),
            "TotalScore", CALCULATE(SUM(FactEmployee_Training[Score]))
        ),
        [TotalScore]
    ),
    REMOVEFILTERS()
)
---------------or-------------
MaxTotalScorePerEmployee =CALCULATE(
MAXX(
    TOPN(
        1,
        ADDCOLUMNS(
            SUMMARIZE(
                ALL(Dim_Employee),
                Dim_Employee[EmployeeID]
            ),
            "TotalScore", CALCULATE(SUM(FactEmployee_Training[Score]))
        ),
        [TotalScore],
        DESC
    ),
    [TotalScore]
),
    REMOVEFILTERS()
)

View solution in original post

6 REPLIES 6
Ahmedx
Super User
Super User

pls try

MaxTotalScorePerEmployee =
CALCULATE(
    MAXX(
        ADDCOLUMNS(
            SUMMARIZE(
                ALL(Dim_Employee),
                Dim_Employee[EmployeeID]
            ),
            "TotalScore", CALCULATE(SUM(FactEmployee_Training[Score]))
        ),
        [TotalScore]
    ),
    REMOVEFILTERS()
)
---------------or-------------
MaxTotalScorePerEmployee =CALCULATE(
MAXX(
    TOPN(
        1,
        ADDCOLUMNS(
            SUMMARIZE(
                ALL(Dim_Employee),
                Dim_Employee[EmployeeID]
            ),
            "TotalScore", CALCULATE(SUM(FactEmployee_Training[Score]))
        ),
        [TotalScore],
        DESC
    ),
    [TotalScore]
),
    REMOVEFILTERS()
)

Thanks a lot, it worked 

Can you let me know why we need to add ADD COLUMNS to get the answer ?

 

Regards,

Ritz

The SUMMARIZE function uses a clustering method. Read more about it here.
https://www.sqlbi.com/articles/differences-between-groupby-and-summarize/
Also, keep in mind that using the REMOVEFILTERS() function ensures that all filters are removed.

Rufyda
Super User
Super User

Max Score All Employees =
CALCULATE(
MAX(Fact_employee_training[Score]),
REMOVEFILTERS(Dim_Employee)
)

MAX(Fact_employee_training[Score]) finds the highest score in the fact table.

REMOVEFILTERS(Dim_Employee) ignores all filters from the employee dimension, giving the maximum score across all employees regardless of employee-level filters.

 


If this response was helpful, please accept it as a solution and give kudos to support other community member.

 

Kedar_Pande
Super User
Super User

@kipi_bi 

Max Score All Employees =
CALCULATE(
MAX(Fact_employee_training[Score]),
ALL(Dim_Employee)
)

 

 

This ignores all filters from the employee dimension and returns the maximum score across all employees.

 

If this answer helped, please click Kudos or mark as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande

 

 

Thanks but it did not work, max will go to the row level which we would like to avoid

 

Regards,

Ritz

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors