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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Min and Max Columns summarising multiple rows

Hi all, 

 

I have a large dataset of half hourly temperatures for two decades. I have created a column which summarises the same days across the multiple years, from 1 to 366 ("Day" column). I need to now calculate the minimum temperature and maximum temperature for each Day (1 to 366). 
I tried a simple DAX Calculate Min filtering by Day but it has not summarised as I wish it to. Further when I did the same for DAX Calculate Max filtering by Day, a circular dependency error occurred. 

amiley_1-1689812750183.png

A table in the report view does this perfectly, however I need to calculate the average between the min and max value for each Day, which I understand has to be computed based on Columns. 

amiley_2-1689812904200.png


Thank you

1 ACCEPTED SOLUTION
barritown
Super User
Super User

Hi @Anonymous,

If I've correctly understood your task, you could solve it with the help of the three measures below and a table visual:

 

MinTemp = MIN ( [Temperature] )

MaxTemp = MAX ( [Temperature] )

AvgTemp = ( [MaxTemp] + [MinTemp] ) / 2

 

In the test case below you can see dates, but it will work with days too:

 barritown_0-1689853467350.png

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @Anonymous,

You can try to use following calculate columns formula to get the max and min temperature based on current date:

daily MinT =
CALCULATE (
    MIN ( Table1[Temperature] ),
    FILTER ( Table1, Table1[Date] = EARLIER ( Table1[Date] ) )
)

daily MaxT =
CALCULATE (
    MAX ( Table1[Temperature] ),
    FILTER ( Table1, Table1[Date] = EARLIER ( Table1[Date] ) )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
barritown
Super User
Super User

Hi @Anonymous,

If I've correctly understood your task, you could solve it with the help of the three measures below and a table visual:

 

MinTemp = MIN ( [Temperature] )

MaxTemp = MAX ( [Temperature] )

AvgTemp = ( [MaxTemp] + [MinTemp] ) / 2

 

In the test case below you can see dates, but it will work with days too:

 barritown_0-1689853467350.png

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.