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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors