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

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

Reply
Anonymous
Not applicable

Measure based on specific value in one col ALSO filtering out a different value in different col?

What I currently have

I currently have a table like so:

 

IndexTypeType (Groups)UnitsPersonnel
0ABC10.5Person A
1DEF21.1Person B
2GHI32Person A
3JKL431Person C
4DEF - a225Person D
5a - JKL456Contractor A
6DEF - ab20.8Contractor B
7GHI - b312Contractor C
8GHI - b30.2Person C
9GHI3111Person D
10JKL433Person A
11ft - DEF262Person B
12GHI - x318Person A
13ABC - a11Person C
14JKL - bc40.3Person A
15JKL40.47Person B
16DEF20.25Person A
17DEF20.17Person A
18GHI33Person B
19JkL44Contractor B
20ABC111Person B
21DEF - zy2100Contractor C
22DEF - zy22.5Person B
23ABC - ab17.5Contractor B
24GHi33.8Person C
25DEF - s28.1Contractor B
26ax - ABC128Person A
27ABC - es197Contractor A

 

The index was created so I could do the following measure:

1. Total Group 1 Measure =

var tab =

ADDCOLUMNS(

'Table',
"Result",
IF(

Table'[Type (groups)]="1",
CALCULATE(

SUM('Table'[Units]),
Table'[Index]=EARLIER('Table'[Index])

)

)

)
return
SUMX(

tab,
[Result]

)

 

I can create the relevant calcs I need from this to sum units based on specific groups. 

What I want to achieve
The problem I now have is that I want to create a new adjustment to this calculation slightly so that it does not include the any Personnel which has "Contractor" in the name so basically "Contractor A", "Contractor B" and "Contractor C".

The end goal is to be able to then total up the figures from this new measure and divide it by the totals of the first measures.

 

Hope this all makes sense.

Thank you.

1 ACCEPTED SOLUTION
mangaus1111
Solution Sage
Solution Sage

Hi @Anonymous ,

try this new measure

Measure = CALCULATE([1. Total Group 1 Measure], NOT CONTAINSSTRING('Facts15'[Personnel],"Contractor"))
 
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
mangaus1111
Solution Sage
Solution Sage

Hi @Anonymous ,

try this new measure

Measure = CALCULATE([1. Total Group 1 Measure], NOT CONTAINSSTRING('Facts15'[Personnel],"Contractor"))
 
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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