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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
NSlater1
Advocate I
Advocate I

Find Max for 2 different columns against two criteria, and then perform calculation

Hi - I am struggling to create in DAX what should be a simple measure that will take the following sample "raw" data and return the outcome underneath. 

 

My aspiration is, for each employee, and against each competence, show the Max value for

1) Requirement and

2) Attained,

- and then also return a calculated difference between Requirement and Attained. 

 

Any help gratefully received 

Data sample:

Employee NumberCompetence CatRequirementAttained
12345130
12345104
123451030
123451002
54321230
54321203
543211120
543211100
543211103

 

Outcome sought

Employee NumberCompetence CatRequirementAttainedCompetence Gap
123451341
123451032-1
543212330
5432111231
1 ACCEPTED SOLUTION
cengizhanarslan
Super User
Super User

You can do this with three measures.

Max Requirement =
MAX ( 'Table'[Requirement] )

Max Attained =
MAX ( 'Table'[Attained] )

Competence Gap =
[Max Attained] - [Max Requirement]
_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.

View solution in original post

3 REPLIES 3
krishnakanth240
Power Participant
Power Participant

Hi @NSlater1 

 

Ensure dont summarize for these columns - Employee Number, Competence Cat

 

krishnakanth240_0-1770735171109.png

 

cengizhanarslan
Super User
Super User

You can do this with three measures.

Max Requirement =
MAX ( 'Table'[Requirement] )

Max Attained =
MAX ( 'Table'[Attained] )

Competence Gap =
[Max Attained] - [Max Requirement]
_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.

Thank you, worked fine- appreciated !

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.