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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.