Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Create average of previous days data

Hi,

 

I have a table which has workout data for diffrent devices for each day. What I want is to get a threshold value which is 30% of the sum of the previous days.

 

So if you see below you will see sample data. Here I have workout per partner for the last 5 days, so I need to create a column/measure which will create a threshold having formula - 

 

Threshold = 0.3*(workout for 20th+19th+18th)

 

Then I will create a compare that if workout for 21st < threshold then highlight the cell as red or have staus as "unhealthy". 

 

Can anyone help. 

 

Partner NameWorkout DateTotal Workouts
APPLE17/10/2019 00:001463490
APPLE18/10/2019 00:001436614
APPLE19/10/2019 00:001341512
APPLE20/10/2019 00:001356111
APPLE21/10/2019 00:001494047
FITBIT17/10/2019 00:00552295
FITBIT18/10/2019 00:00370275
FITBIT19/10/2019 00:00371072
FITBIT20/10/2019 00:00377244
FITBIT21/10/2019 00:00494469
GARMIN17/10/2019 00:00585582
GARMIN18/10/2019 00:00547174
GARMIN19/10/2019 00:00575836
GARMIN20/10/2019 00:00597525
GARMIN21/10/2019 00:00597247

 

  • Hi,

    just for fun i added in another partner, to show the case when below threshold:

     

    Above is the visual and below is the working columns. for example sake i used date as today()-1 (21st oct)

    I make sure of main cal columns, prehaps a more efficient way would be to use measure, i look forward to other better solution, meanwhile i hope this ans your question.

    attached PBIX: PBIX 

     

    regards

     

     

     

3 Replies

  • YJ's avatar
    YJ
    Resolver II

    Hi,

    just for fun i added in another partner, to show the case when below threshold:

     

    Above is the visual and below is the working columns. for example sake i used date as today()-1 (21st oct)

    I make sure of main cal columns, prehaps a more efficient way would be to use measure, i look forward to other better solution, meanwhile i hope this ans your question.

    attached PBIX: PBIX 

     

    regards

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

       

      Thank you so much for this. Just had to make some small tweeks in the threshold formula and I was able to achieve my requirement.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi YJ ,

       

      I had to change my connection mode to DirectQuery mode and now the functions you provided are not working. Can you help please.