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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
DataSundowner
Helper II
Helper II

DAX to Ignore Filters in Table Visual

Hello community, I'm trying to create a measure to calculate total per group that ignores some filters/columns in the table visualization. I've tried REMOVEFILTERS() and ALLEXCEPT(), but they are not returning what I'm looking for. In my student test example below, I want this measure to calcualte total test score per student, class and subject. Thank you in advance. 

 

Model:

DataSundowner_0-1740764667144.png

 

Table "tests":

DataSundowner_1-1740764852368.png

 

Table "class_dim":

DataSundowner_2-1740764883825.png

 

Table "student_dim":

DataSundowner_3-1740764916605.png

 

Table "subject_dim":

DataSundowner_4-1740764947456.png

 

Result - using REMOVEFILTERS(). Issue: Returning correct totals, but creating extra unwanted rows. Also, I need to modify REMOVEFILTERS() in the measure everytime I need to introduce new columns from "tests" table to the visual. 

total score - remove filters = 
CALCULATE(
    SUM(tests[score]),
    REMOVEFILTERS(tests[test]),
    REMOVEFILTERS(tests[test_date])
)

 

DataSundowner_5-1740765093187.png

 

Result - Using ALLEXCEPT(). Issue: Not summing correctly by group. 

total score - all except = 
CALCULATE(
    SUM(tests[score]),
    ALLEXCEPT(student_dim, student_dim[student]),
    ALLEXCEPT(class_dim, class_dim[class]),
    ALLEXCEPT(subject_dim, subject_dim[subject])
)

 

DataSundowner_6-1740765189824.png

 

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.  Show the problem and expected result very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
techies
Super User
Super User

Hi @DataSundowner 

 

Please check this

 

Total Score =
CALCULATE(
SUM(tests[score]),
ALLEXCEPT(tests, tests[student], tests[class], tests[subject])
)

 

 

― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978
Irwan
Super User
Super User

hello @DataSundowner 

 

please check if this accomodate your need.

Irwan_0-1740785277456.png

 

create a new measure for calculating SUM of score (i used your DAX with a little tweak)

Total Score = 
CALCULATE(
    SUM(tests[score]),
    FILTER(
        ALLEXCEPT('tests','student'[student],'subject'[subject],'class'[class]),
        'tests'[test_date]<=MAX('tests'[test_date])
    )
)
i add that red line. this measure will calculate total score based on same student, subject, and class as you did above.
 
however, as you can see above, the second line has total score of 78 instead of 167.
this happens because of filter in table visual as you mentioned in your post above.
second line and third line are student a, class 1, and subject math but the test is different.

if you want to show only the maximum of sum value, then try creating another measure with following DAX.
Total Score MAX = 
var _Student = SELECTEDVALUE('tests'[student])
var _Subject = SELECTEDVALUE('tests'[subject])
var _Class = SELECTEDVALUE('tests'[class])
Return
MAXX(
    FILTER(
        ALL('tests'),
        'tests'[student]=_Student&&
        'tests'[subject]=_Subject&&
        'tests'[class]=_Class
    ),
    [Total Score]
)
this DAX will take the maximum value of total score based on same student, same subject, and same class (ignoring the test different).

Hope this will help.
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.