Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
what is the best way to calculate average duration but disregard durations smaller or equal 1 second?
My measure for all duration is now like this:
Solved! Go to Solution.
@Applicable88 Yes, you can.
AVERAGEX(FILTER('Machine', 'Machine'[Duration] > 1), 'Machine'[Duration])
Cheers!
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂 (Hit the thumbs up button!)
If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)
https://www.vivran.in/
Connect on LinkedIn
If your column was type Duration in the query editor, it was converted to a decimal value (in days) when loaded. You can use a measure expression like this to filter out durations <1 sec.
NewMeasure = CALCULATION(SUM(Table[Duration]), Table[Duration] > 1/(24*60*60))
For more about modelling and "measure"-ing time/durations, please see these videos.
(4) It's About Time - Part One - YouTube
(4) It's About Time - Part Two - YouTube
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
If your column was type Duration in the query editor, it was converted to a decimal value (in days) when loaded. You can use a measure expression like this to filter out durations <1 sec.
NewMeasure = CALCULATION(SUM(Table[Duration]), Table[Duration] > 1/(24*60*60))
For more about modelling and "measure"-ing time/durations, please see these videos.
(4) It's About Time - Part One - YouTube
(4) It's About Time - Part Two - YouTube
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi @vivran22 thank you very much.
Is there also a way to write it with Averagex, in case I want to iterate.
Best.
@Applicable88 Yes, you can.
AVERAGEX(FILTER('Machine', 'Machine'[Duration] > 1), 'Machine'[Duration])
Cheers!
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂 (Hit the thumbs up button!)
If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)
https://www.vivran.in/
Connect on LinkedIn
Hello @Applicable88
You may try add a filter to your CALCULATE statement:
CALCULATE(AVERAGE('Machine'[Duration]), 'Machine'[Duration] > 1)
Cheers!
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂 (Hit the thumbs up button!)
If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)
https://www.vivran.in/
Connect on LinkedIn
User | Count |
---|---|
77 | |
74 | |
42 | |
32 | |
28 |
User | Count |
---|---|
99 | |
92 | |
50 | |
49 | |
46 |