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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Syndicate_Admin
Administrator
Administrator

Dates, Highs and Lows

Hello, I need please if you can help me with the following:

I have several teams that have the name of the letter A to Z, each one is distributed in a geographical area and its function is to take the temperature of the place every day and every year.
Each computer keeps a daily record with the following data: the name of the equipment, the date and the temperature of that day.

Example:

marcoms_0-1678918734640.png

What I need is to take out a matrix where it shows me the maximum and minimum temperature of all the months of the year of each team and also must show the date of that maximum and minimum.

Something like this:

marcoms_1-1678918887674.png

I tried to take it out but I can't, could you help me please?

Thanks a lot.

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

 

Here I create a sample to have a test.

Data model:

RicoZhou_1-1679297961007.png

Measure:

Fecha de Temp Max = 
VAR _MAX =
    MAX ( 'Table'[Temperatura] )
VAR _DATE =
    CALCULATETABLE (
        VALUES ( DimDate[Date] ),
        FILTER ( 'Table', 'Table'[Temperatura] = _MAX )
    )
VAR _COMBINE =
    CONCATENATEX ( _DATE, [Date], "
" )
RETURN
    _COMBINE
Fecha de Temp Min = 
VAR _Min =
    MIN ( 'Table'[Temperatura] )
VAR _DATE =
    CALCULATETABLE (
        VALUES ( DimDate[Date] ),
        FILTER ( 'Table', 'Table'[Temperatura] = _Min )
    )
VAR _COMBINE =
    CONCATENATEX ( _DATE, [Date], "
" )
RETURN
    _COMBINE
Max Temp for each Equipos = CALCULATE(MAX('Table'[Temperatura]),ALLEXCEPT('Table','Table'[Equipos])) 
Fecha de Temp Max for each Equipos = 
VAR _DATE =
    CALCULATETABLE (
        VALUES ( DimDate[Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Equipos] = MAX ( 'Table'[Equipos] )
                && 'Table'[Temperatura] = [Max Temp for each Equipos]
        )
    )
VAR _COMBINE =
    CONCATENATEX ( _DATE, [Date], "
" )
RETURN
    _COMBINE

Result is as below.

RicoZhou_0-1679297943589.png

You can download my sample file to learn more about measures.

 

Best Regards,
Rico Zhou

 

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-rzhou-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

 

Here I create a sample to have a test.

Data model:

RicoZhou_1-1679297961007.png

Measure:

Fecha de Temp Max = 
VAR _MAX =
    MAX ( 'Table'[Temperatura] )
VAR _DATE =
    CALCULATETABLE (
        VALUES ( DimDate[Date] ),
        FILTER ( 'Table', 'Table'[Temperatura] = _MAX )
    )
VAR _COMBINE =
    CONCATENATEX ( _DATE, [Date], "
" )
RETURN
    _COMBINE
Fecha de Temp Min = 
VAR _Min =
    MIN ( 'Table'[Temperatura] )
VAR _DATE =
    CALCULATETABLE (
        VALUES ( DimDate[Date] ),
        FILTER ( 'Table', 'Table'[Temperatura] = _Min )
    )
VAR _COMBINE =
    CONCATENATEX ( _DATE, [Date], "
" )
RETURN
    _COMBINE
Max Temp for each Equipos = CALCULATE(MAX('Table'[Temperatura]),ALLEXCEPT('Table','Table'[Equipos])) 
Fecha de Temp Max for each Equipos = 
VAR _DATE =
    CALCULATETABLE (
        VALUES ( DimDate[Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Equipos] = MAX ( 'Table'[Equipos] )
                && 'Table'[Temperatura] = [Max Temp for each Equipos]
        )
    )
VAR _COMBINE =
    CONCATENATEX ( _DATE, [Date], "
" )
RETURN
    _COMBINE

Result is as below.

RicoZhou_0-1679297943589.png

You can download my sample file to learn more about measures.

 

Best Regards,
Rico Zhou

 

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

 

Syndicate_Admin
Administrator
Administrator

If I had to get the date of the maximum temperature value, how would it be?

Thank you.

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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