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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

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

 

1 ACCEPTED SOLUTION
YJ
Resolver II
Resolver II

Hi,

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

20191022_BI_ash.JPG

 

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

 

 

 

View solution in original post

3 REPLIES 3
YJ
Resolver II
Resolver II

Hi,

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

20191022_BI_ash.JPG

 

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
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. 

 

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.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors