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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.