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
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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.