Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
20 | |
14 | |
10 | |
9 | |
6 |