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
MichaelG_NAC
Frequent Visitor

Comparing value between years based on another column

Hello 

I am looking to compare Values between diffrent years 

YearUniqueValue

1

A5
1B10
2A15
3C16
2B20


so at the end im looking to have a subtraction from the highest year - the lowest year based on the Unique 

 

UniqueValue
A10 (15-5)
B10 (20-10)
C16

 

Would this be possible or would another method be needed

1 ACCEPTED SOLUTION
DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

try this:

 

Measure 4 = var _max = CALCULATE(max('Table (3)'[Value]),ALLEXCEPT('Table (3)','Table (3)'[Unique]))

var _min = CALCULATE(min('Table (3)'[Value]),ALLEXCEPT('Table (3)','Table (3)'[Unique]))

return

 if(COUNT('Table (3)'[Unique])=1,_max,_max - _min)
 
DOLEARY85_0-1681910578166.png

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

View solution in original post

1 REPLY 1
DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

try this:

 

Measure 4 = var _max = CALCULATE(max('Table (3)'[Value]),ALLEXCEPT('Table (3)','Table (3)'[Unique]))

var _min = CALCULATE(min('Table (3)'[Value]),ALLEXCEPT('Table (3)','Table (3)'[Unique]))

return

 if(COUNT('Table (3)'[Unique])=1,_max,_max - _min)
 
DOLEARY85_0-1681910578166.png

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Helpful resources

Announcements
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.