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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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
Memorable Member
Memorable Member

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.