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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Dalton948
Frequent Visitor

Average between a set of numbers filtered on a Unique ID and each occurrence of a specific name

Good Evening, 

I am in the process of trying to figure out how to get a duration Average where as the duration is already provided. My issue is getting the filter right as i need filter on each unique ID in a large table, grab each occurance of a name and its associated #(Duration), and then caluclate the average.

This is my query measure thus far,

Ticket Time AVG =

VAR _CurrentElement_ID = MAX('Fabled Metric Table'[id_sys_id])
VAR _tbl = FILTER(ALL('Fabled Metric Table'),'Fabled Metric Table'[id_sys_id]=_CurrentElement_ID & 'Fabled Metric Table'[value_metric_instance] = "TOC_OPS")
VAR _avg = AVERAGEX(_tbl,'Fabled Metric Table'[duration])

Return _avg

Here is the table i am trying to work on,
Dalton948_0-1737781609036.png

I have isolated to one unique ID there which is id_sys_id and am trying to get the duration average between all the instances that say TOC_OPS.

Welcoming any suggestions, thanks in advance.

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Dalton948 

Please try:

Ticket Time AVG =
VAR _CurrentElement_ID =
    MAX ( 'Fabled Metric Table'[id_sys_id] )
VAR __Result =
    CALCULATE (
        AVERAGE ( 'Fabled Metric Table'[duration] ),
        'Fabled Metric Table'[id_sys_id] = _CurrentElement_ID,
        'Fabled Metric Table'[value_metric_instance] = "TOC_OPS"
    )
RETURN
    __Result
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Dalton948
Frequent Visitor

This worked pretty well, i also forgot to change the duration column to whole numbers. Once i checked that and with your formula, it worked like a charm. Thanks for your help!

Fowmy
Super User
Super User

@Dalton948 

Please try:

Ticket Time AVG =
VAR _CurrentElement_ID =
    MAX ( 'Fabled Metric Table'[id_sys_id] )
VAR __Result =
    CALCULATE (
        AVERAGE ( 'Fabled Metric Table'[duration] ),
        'Fabled Metric Table'[id_sys_id] = _CurrentElement_ID,
        'Fabled Metric Table'[value_metric_instance] = "TOC_OPS"
    )
RETURN
    __Result
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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