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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Calculate differance between min and max for value for each date

I have the following table and want to calculate the difference for each date.

How do I do this in a measure?

First date should be: 20

Second date should be: 60

 

TimeValueCategory 1
2022-01-0150A
2022-01-0130A
2022-01-0145B
2022-01-0147B
2022-01-0251A
2022-01-0252A
2022-01-0270A
2022-01-0220B
2022-01-0222B
2022-01-0210C
2022-01-0314A

 

1 REPLY 1
DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

try this:

 

Measure 4 = var _min = CALCULATE(min('Table (4)'[Value]),ALLEXCEPT('Table (4)','Table (4)'[Time]))
var _max = CALCULATE(max('Table (4)'[Value]),ALLEXCEPT('Table (4)','Table (4)'[Time]))

return
CALCULATE(sum('Table (4)'[Value]),'Table (4)'[Value]=_max)-CALCULATE(sum('Table (4)'[Value]),'Table (4)'[Value]=_min)
 
DOLEARY85_0-1681822308135.png

 

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors