Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
4 years ago
Solved

undefined

Good community!!!

I am trying to create a MEASURE or COLUMN to display on a card the average value of the last hour. I know, that in a table organizing the hierarchies of Date and Time I can show it. But I want to show the value directly on a card, without the need to apply filters, something like the average value of the last hour in real time.

In the following table I specify the following data:

Fr4ncoFerr3r_0-1648467473056.png

Apply an averange and I arrive at the expected result by applying from a filter panel the selection of the date and time. But the idea is that by default and without applying filters the card can show me the values.

Fr4ncoFerr3r_1-1648467598189.png

Those would be the expected values, but without having to apply filters.

Currently I am only applying an AVERANGE, but I do not know how to specify that I calculate the last minute value. Taking as a sample the four registers hs.

Prom EJE3 = CALCULATE(AVERAGE('f_ejemplo'[EJE3]))
I leave the pbix file so they can look at the data and measurements.
Best regards!
I await your comments.
Best regards!!!

  • Hi Syndicate_Admin ,

    According to your description, I download your sample, here's my solution.

    Create a measure.

    Promedio_Nivel = 
    CALCULATE (
        AVERAGE ( muestra[Nivel_1] ),
        FILTER (
            ALL ( 'muestra' ),
            HOUR ( 'muestra'[Fecha_Hora] )
                = MAXX ( ALL ( 'muestra' ), HOUR ( 'muestra'[Fecha_Hora] ) )
        )
    )
    

    Get the correct result without a slicer.

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

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

3 Replies

  • Syndicate_Admin , if you have datetime column, you can create a measure like

     

    calculate( Count(Table[Value]), filter(Table, Table[Datetime] >= now() -time(1,0,0) && Table[Datetime] < now() ) ) 

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator

      Dear.

      Thanks for the help. But it didn't work.

      The expression

      EXAMPLE =
      CALCULATE(COUNT('f_ejemplo'[EJE3]), filter('f_ejemplo', 'f_ejemplo'[Fecha_Hora] >= now() -time(1,0,0) && 'f_ejemplo'[Fecha_Hora] < now() ))
      It throws blank vlaroes at me.
      Fr4ncoFerr3r_0-1648471300245.png

      Nose if I should put the YTD.

      I await comments. Best regards.

  • Hi Syndicate_Admin ,

    According to your description, I download your sample, here's my solution.

    Create a measure.

    Promedio_Nivel = 
    CALCULATE (
        AVERAGE ( muestra[Nivel_1] ),
        FILTER (
            ALL ( 'muestra' ),
            HOUR ( 'muestra'[Fecha_Hora] )
                = MAXX ( ALL ( 'muestra' ), HOUR ( 'muestra'[Fecha_Hora] ) )
        )
    )
    

    Get the correct result without a slicer.

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

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