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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
arnomil
New Member

Calculate number of daily average over a threshold from data at 10 minutes frequency

Hi

 

I have those data (10 minutes frequency)

Date                      PM10

01/05/21 05:03     12
01/05/21 04:53     10
01/05/21 04:43     8
01/05/21 04:33     10
01/05/21 04:23      5
01/05/21 04:13     4
01/05/21 04:03     4

I need to :

1. calculate the PM10 daily average

2. count the number of days whose daily average is over a threshold (50)

 

For 1) I do this :

PM10 Average by Day =
AVERAGEX(
    KEEPFILTERS(VALUES('T'[Date].[Day])),
    CALCULATE(AVERAGE('T'[PM10]))
)
and then :
PM10 daily threshold passing = IF([PM10 Average by Day] >= 50, TRUE(), FALSE())
 
But I can't get the number of days above the threshold...
 
Thanks in advance !
 

 

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@arnomil 

maybe you can create a date column without time

DATE2 = INT('Table'[DATE])
AVERAGE = AVERAGE('Table'[PM 10])
Measure1 =
VAR tbl=FILTER(SUMMARIZE('Table','Table'[DATE2],"avg",AVERAGE('Table'[PM 10])),[avg]>50)
return COUNTROWS(tbl)
1.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@arnomil 

maybe you can create a date column without time

DATE2 = INT('Table'[DATE])
AVERAGE = AVERAGE('Table'[PM 10])
Measure1 =
VAR tbl=FILTER(SUMMARIZE('Table','Table'[DATE2],"avg",AVERAGE('Table'[PM 10])),[avg]>50)
return COUNTROWS(tbl)
1.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@ryan_mayu great, exactly what I need !

Getting the answer a couple of minutes after my very first post... that's what I call a community !

thanks again ryan.

@arnomil 

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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