Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
In a table i have column called "Object" which runs multiple times in a day and that runtime is captured in "StartTime" & "EndTime" columns, and the difference between the start and end time is captured in the "Duration" Column.
Each object will be having multiple runid's which is captured in "RunID" column which is a unique value.
For eg: Object AAA has two runid's called "111,222" and Object BBB has one runid called "333".
Now i would like to get the average of each duration by count of that particular runid which is captured in "New Duration" column.
For eg:
Sample screenshot for above query:
So since my Duration is "10" and total count of runid (111) is 10. So 10/10=1 that is my newduration.Similarly for all durations with runid's 111 should be divided bt 10.
How to achieve this using DAX query??
I am connecting to this table in powerbi via SQL direct query mode.
Thanks.
Solved! Go to Solution.
Hi @Anonymous ,
Maybe you can try this DAX:
Measure =
DIVIDE (
SUM ( 'Table'[Duration] ),
CALCULATE (
COUNTROWS ( 'Table' ),
ALLEXCEPT ( 'Table', 'Table'[RunID] )
)
)
Result:
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Maybe you can try this DAX:
Measure =
DIVIDE (
SUM ( 'Table'[Duration] ),
CALCULATE (
COUNTROWS ( 'Table' ),
ALLEXCEPT ( 'Table', 'Table'[RunID] )
)
)
Result:
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi ,
can somebody help on this issue please??
Thanks.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
20 | |
14 | |
10 | |
9 | |
6 |