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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

Finding the maximum temperature recorded for a day

Hi all,

 

I have a dataset that contains timestamps and temperature. I am interested in finding the maximum temperature recorded for each day for last week. The data recorded in about every 2 mins. The relative date slicers are not applicable as it does not help if the dataset is not refreshed. 

Please help me on how to do this with DAX. Thanks.

Regards,

Vipul Toshniwal

PSCapture.PNG

 

 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @VipulToshniwal ,

You can try this measure to achieve maximum temperature of a day:

 

Max_temperature of current day =

VAR _curr =

    SELECTEDVALUE ( 'Table'[timestamp_IST] )

RETURN

    CALCULATE (

        MAX ( 'Table'[Temperature] ),

        FILTER (

            ALL ( 'Table' ),

            YEAR ( 'Table'[timestamp_IST] ) = YEAR ( _curr )

                && MONTH ( 'Table'[timestamp_IST] ) = MONTH ( _curr )

                && DAY ( 'Table'[timestamp_IST] ) = DAY ( _curr )

        )

    )

 

You will get the result like this:

maximum temperature.png

Here is the demo, please try it:

PBIX 

 

Best Regards,

Yingjie Li

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yingjl
Community Support
Community Support

Hi @VipulToshniwal ,

You can try this measure to achieve maximum temperature of a day:

 

Max_temperature of current day =

VAR _curr =

    SELECTEDVALUE ( 'Table'[timestamp_IST] )

RETURN

    CALCULATE (

        MAX ( 'Table'[Temperature] ),

        FILTER (

            ALL ( 'Table' ),

            YEAR ( 'Table'[timestamp_IST] ) = YEAR ( _curr )

                && MONTH ( 'Table'[timestamp_IST] ) = MONTH ( _curr )

                && DAY ( 'Table'[timestamp_IST] ) = DAY ( _curr )

        )

    )

 

You will get the result like this:

maximum temperature.png

Here is the demo, please try it:

PBIX 

 

Best Regards,

Yingjie Li

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

Create a date field

 Date = Table[Datetime].date

 

And then you can display is against each date

Prefer using a date dimension

 

In case you want to take max and sum refer

https://community.powerbi.com/t5/Desktop/SUM-of-AVERAGE/td-p/197013

 

Also refer :https://community.powerbi.com/t5/Desktop/highest-value-by-category/td-p/428758

 

In any case you need to create a date column

Appreciate your Kudos.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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