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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
PoweredOut
Resolver I
Resolver I

Measure Should populate ID row in Matrix

Good morning

 

I  have a matrix visual with IDs on the row Level from 'DIM Emp'[EmpID]

 

I would like to create a measure that populates the row of certain ids. In this case IDs  5 & 6 should be populated with the result of the 1st part of the measure, the rest with the 2nd part

 

Something along the lines of 

Emp = 
IF (
    MAX ( 'DIM Emp'[EmpID]) IN { 5 , 6}
        CALCULATE (
            SUM ( 'HC'[Amount] ),
            KEEPFILTERS (
                'DIM Emp'[EmpID] IN { 2, 3, 4 }
            )
        ) - CALCULATE (
            SUM ( 'HC'[Amount] ),
            KEEPFILTERS ( 'DIM Emp'[EmpID] = 7 )
        )
    ,
    CALCULATE (
        SUM ( 'HC'[Amount]),
        KEEPFILTERS (
            'DIM Emp'[EmpID]
                IN { 11, 10, 12 }
  )))

Thanks

3 REPLIES 3
tamerj1
Super User
Super User

HI @PoweredOut 
Having KEEPFILTERS will defenitely return blank everywhere. Please try without it

Emp =
IF (
    MAX ( 'DIM Emp'[EmpID] ) IN { 5, 6 },
    CALCULATE ( SUM ( 'HC'[Amount] ), 'DIM Emp'[EmpID] IN { 2, 3, 4 } )
        - CALCULATE ( SUM ( 'HC'[Amount] ), 'DIM Emp'[EmpID] = 7 ),
    CALCULATE ( SUM ( 'HC'[Amount] ), 'DIM Emp'[EmpID] IN { 11, 10, 12 } )
)

 

Thanks for replying @tamerj1 

 

I get the same result after removing the KEEPFILTERS. The measure seems to be ignoring the condition of the if statements and the result is the 2nd part

 

 

@PoweredOut 
Can you please provide some screenshots?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors