Forum Discussion

MCassady's avatar
MCassady
Icon for Helper I rankHelper I
3 years ago
Solved

Help Getting Average of Minimum Daily Values for Specified Month

Hello,

 

I am trying to do a calculation which is the AVERAGE of the MIN temperature values by DAY in the month.

 

For example, if a user picks 2022/10/20 in the slicer, the measure must go and grab the last 5 years worth of data, for every day in october, calculate the daily MIN for each day, then return the AVERAGE of those values for use on a line chart.

 

I have included a sample below. The measure I was working with is called Temperature - 5Year Average Daily Min.

PBIX:
https://drive.google.com/file/d/1FF_VLnHGGfUNDfD-ODQ40OiOAmqpcYBC/view?usp=share_link

The results of the measure are expected to be the below values:

10.32022-10-01
10.362022-10-02
10.662022-10-03
10.922022-10-04
9.562022-10-05
12.622022-10-06
13.642022-10-07
12.322022-10-08
12.722022-10-09
14.342022-10-10
11.382022-10-11
9.622022-10-12
10.962022-10-13
10.262022-10-14
8.922022-10-15
6.962022-10-16
6.182022-10-17
6.882022-10-18
6.762022-10-19
8.22022-10-20
8.42022-10-21
8.442022-10-22
8.982022-10-23
6.242022-10-24
5.122022-10-25
4.542022-10-26
6.462022-10-27
5.92022-10-28
6.162022-10-29
4.382022-10-30
5.12022-10-31

 

  • MCassady , You can use a measure like this which will sum above the day level.

     

    sumx(Values(Table[Date]), calculate(Min(Table[Value])) )

3 Replies

  • MCassady , You can use a measure like this which will sum above the day level.

     

    sumx(Values(Table[Date]), calculate(Min(Table[Value])) )

    • MCassady's avatar
      MCassady
      Icon for Helper I rankHelper I

      Hey amitchandak 

       

      I am trying something like this in my measure as seen in the example file.  Although I am using averagex instead of sumx because I am looking for the average.  

       

      I am also using some extra filters that the other working measure is using. 

       

      I am not getting my expected results still. 

  • I figured out what was wrong. I was accidentally including the current year in my "Previous 5 years average".

    Just me not being careful enough.