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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
davorgom
Frequent Visitor

Help

 

Hello everyone.

I have been trying to subtract values ​​from a table with a fixed measurement (first in the ranking, second, third ...), but I can't.

I would like to know if any of you can help me.

 

 

Screenshot_20200508-235009_Excel.jpg

 

1 ACCEPTED SOLUTION

@davorgom  if you want to compare with 6th position,  This should be calculated column, not measure

 

 

Compare 6th Position = 
var _sub=FILTER('Table','Table'[Position]=6)
var _2max=MAXX(_sub,[Distance])
var result= _2max-'Table'[Distance]
return result

 

This should be calculated column, not measure.

 

Can you provide your original data, so that i can test it.

Also I have modified my reply a little bit. Please try again.



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

View solution in original post

3 REPLIES 3
nandukrishnavs
Super User
Super User

@davorgom 

 

 

PositionDistance
110.5
210.3
39
47
56
65

 

Create two calculated columns.

 

 

 

Compare 1st Position = 
var _1max=MAX('Table'[Distance])
var result= _1max-'Table'[Distance]
return result
Compare 2nd Position = 
var _sub=FILTER('Table','Table'[Position] = 2)
var _2max=MAXX(_sub,[Distance])
var result= _2max-'Table'[Distance]
return result

 

 

 

Capture.JPG



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂

 


Regards,
Nandu Krishna

I appreciate your answer. I wanted to tell you that when I copied and pasted the DAX formula, I get an error in the penultimate line. Anotación 2020-05-09 123200.jpgDo you know why it could be?

 

On the other hand, I saw the two measurements, and they only differ from each other using MAX and MAXX. If I wanted to compare the value of the 6th position with the rest of the results, what should I change?

 

I appreciate your time and knowledge.

 

Blessings from Colombia

@davorgom  if you want to compare with 6th position,  This should be calculated column, not measure

 

 

Compare 6th Position = 
var _sub=FILTER('Table','Table'[Position]=6)
var _2max=MAXX(_sub,[Distance])
var result= _2max-'Table'[Distance]
return result

 

This should be calculated column, not measure.

 

Can you provide your original data, so that i can test it.

Also I have modified my reply a little bit. Please try again.



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors