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
Johannes_W
Regular Visitor

Yearly average of an aggregate measure, again

 Dear all,

 

it seems this kind of question comes up often, but I can not seem to find a solution.

Here is my situation.

 

I have a list of prcesses that happen at a specific date. Each process has a number of events (some just a few, some hundreds) which may or may not fail.

 

Table1

Process   event_id   failed?   
A10
A20
A31
B41
B51
C60
C70
D80
D91
D101
D110

 

I also have a date table that tells me in which year the processes have run

A2020
B2020
C2019
D2019

 

I have created a measure that claculates for each process the percentage of failed events

 

%failed = DIVIDE( SUM('Table1'[failed]), COUNT('Table1'[event_id]) )
 
very naively, I just sum up the 1s and divide by the number of events.
 
This works nicely when I look at the individual processes.
Process  %failed  Year  
A33%2020
B100%2020

C

0%

2019

D

50%

2019

 

However: what I would like to achieve is a measure that now gives me the average %failed over all processes each year
(2020 = 66.5%, 2019 = 25%)
 
When I simply slice by year, what I get is the total % of all EVENTS in that year, not the average percentage by process.
(2020 = 60% and 2019 = 40 %)
This doesn't help me, because as I said, the number of events can differ vastly thus ruining the statistics.
 
Any advice is apprechiated.
Thanks!
Joh
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @Johannes_W 

Please check the below picture and the sample pbix file's link down below.

When you put the Process column into the visualization, the correct result is still shown.

 

Picture4.png

 

failed percentage =
VAR newtable =
SUMMARIZE (
Data,
Data[Process],
"@idcount", COUNT ( Data[event_id] ),
"@failed", SUM ( Data[failed] )
)
RETURN
AVERAGEX ( newtable, [@failed] / [@idcount] )
 
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, @Johannes_W 

Please check the below picture and the sample pbix file's link down below.

When you put the Process column into the visualization, the correct result is still shown.

 

Picture4.png

 

failed percentage =
VAR newtable =
SUMMARIZE (
Data,
Data[Process],
"@idcount", COUNT ( Data[event_id] ),
"@failed", SUM ( Data[failed] )
)
RETURN
AVERAGEX ( newtable, [@failed] / [@idcount] )
 
 
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Dear Jihwan,

 

that works perfectly, thank you so much! I need to ponder on why it works though.

Thanks!

Joh

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.