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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
irukandjix
Frequent Visitor

Matrix row and column totals with excluded measure values

Table without restirictions has two dimensions Color and Number. Value cells has values from a measure (we can call it CellSum) that sums up values with these dimensions. I want to exclude all values below 4 from counted totals, but want to see these values in the matrix. See example. How can we achive this with dax code?

 

Table without restrictions:

irukandjix_0-1701441057280.png

 

Desired table (red lines just to show which values we want to exclude from totals):

irukandjix_1-1701441103532.png

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @irukandjix 

I would suggest a measure along these lines (replace table/column references as needed):

CellSum Modified = 
VAR Threshold = 4
RETURN
    IF (
        AND ( ISINSCOPE ( Number[Number] ), ISINSCOPE ( Color[Color] ) ),
        [CellSum],
        SUMX (
            SUMMARIZE ( YourTable, Color[Color], Number[Number] ),
            VAR CellSum = [CellSum] RETURN IF ( CellSum >= Threshold, CellSum )
        )
    )

ISINSCOPE is used to detect whether you are in an individual Color/Number cell.

 

Does something like this work for you?

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

2 REPLIES 2
irukandjix
Frequent Visitor

Very nice solution, thank you @OwenAuger ! Your magic does exactly what is wanted!

OwenAuger
Super User
Super User

Hi @irukandjix 

I would suggest a measure along these lines (replace table/column references as needed):

CellSum Modified = 
VAR Threshold = 4
RETURN
    IF (
        AND ( ISINSCOPE ( Number[Number] ), ISINSCOPE ( Color[Color] ) ),
        [CellSum],
        SUMX (
            SUMMARIZE ( YourTable, Color[Color], Number[Number] ),
            VAR CellSum = [CellSum] RETURN IF ( CellSum >= Threshold, CellSum )
        )
    )

ISINSCOPE is used to detect whether you are in an individual Color/Number cell.

 

Does something like this work for you?

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.