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
Anonymous
Not applicable

Help with creating a measure of counterpart

Hi,

I have below table that I need to create a measure which is as below:

%Gap = % Rcvd - Avg Change by Race (but only considering Race C) or I can say it in a different way as below:

%Gap = %Rcvd (Race A=7.4%) - %Rcvd (Race C=8.5%) = -1.0%

%Gap = %Rcvd (Race B=5.9%) - %Rcvd (Race C=8.5%) = -2.6%

How can I create a measure that can get me the results as in "Expected Results" column?

Race NameCount EECount Recvd% RcvdAVG Change by RaceExpected Results
Race A1717.4%8.5%-1.0%
Race B2845.9%8.5%-2.6%
Race C (Counterpart)5958.5%  
1 ACCEPTED SOLUTION

To have better support from the community in future posts it is advised to share details about your model.

The model here refers to your various table structure, relationships and sample data at least of the main tables.

 

Try this:

 

%Gap =
[% Rcvd]
    - CALCULATE ( 
        [% Rcvd], 
        A_Table[Race Name] = "Race C (Counterpart)" 
    )

 

View solution in original post

9 REPLIES 9
Mohammad_Refaei
Solution Specialist
Solution Specialist

Add a calculated column:

%Gap =
[% Rcvd]
    - CALCULATE (
        MAX ( Data[% Rcvd] ),
        FILTER ( ALL ( Data ), Data[Race Name] = "Race C (Counterpart)" )
    )

 

Replace "Data" with your table name.

Anonymous
Not applicable

Hi,

Thank you for your help. I didn't get the same expected result which 8.5%. I need to highlight that % Rcvd is a measure. And I'm wondering why you used MAX and what I need is Average of this measure.

I'm sorry if I wasn't that clear, but hope you could help and understood what I exactly want.

 

Thank you!

Well, you can try this:

 

%Gap Measure =
[% Rcvd]
    - CALCULATE (
        AVERAGE ( [% Rcvd] ),
        FILTER ( ALL ( Data ), Data[Race Name] = "Race C (Counterpart)" )
    )

 

If it is not workinig for any reason then please share more details about your model in otrder to avoid any confusion.

Anonymous
Not applicable

The result of below part is 3.5% not 8.5%, did you try it yourself?

CALCULATE (
        AVERAGE ( [% Rcvd] ),
        FILTER ( ALL ( Data ), Data[Race Name] = "Race C (Counterpart)" )

Mohammad_Refaei_0-1631559742490.png

This is what I get.

 

Please share details about your model to be able to help.

Anonymous
Not applicable

Here's some more details about my measures:

% Rcvd = CALCULATE( AVERAGE(A_Table[Base Pay Change Percent]), FILTER(A_Table,A_Table[Promotion Given (Y/N)]="Yes")

And when to adjust the measure to below:

%Gap Measure = [% Rcvd] 
- CALCULATE( [% Rcvd], 
FILTER(ALL(A_Table),A_Table[Mapped Race] = "Race C (Counterpart)") )

I got 1.2% for Race A and -0.3% for Race B. I removed the average before % Rcvd as the measure is already AVG

To have better support from the community in future posts it is advised to share details about your model.

The model here refers to your various table structure, relationships and sample data at least of the main tables.

 

Try this:

 

%Gap =
[% Rcvd]
    - CALCULATE ( 
        [% Rcvd], 
        A_Table[Race Name] = "Race C (Counterpart)" 
    )

 

Anonymous
Not applicable

Thank you for being patient and walking me through the best solution, I really appreciate your kind patient and support. I'm kinda new here and in learning process.

Most welcome.... my pleasure

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.

Top Solution Authors