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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mbailey
Helper II
Helper II

Need Measure to Average results of another Measure

Hi,

 

I have a Measure, MTBF = IFERROR([NumDaysInDateRange]/[NumSROs],BLANK()) that calcs the MTBF for every Unit,  per Partner, within a give date range:

 

mbailey_0-1633446950368.png

 

Now, I need to make a measure, or some other method, that will return the Average MTBF per Partner within the select Date range as well, but I have no idea how to accomplish this. These results will be on a separate tab and be in the form of a table with the Partner's name and their Average MTBF.

 

Suggestions?

 

Thanks,

Mike

 

 

1 ACCEPTED SOLUTION

Does what I suggested not work for averaging over units?

 

AvgPerUnit = AVERAGEX ( VALUES ( Table1[Unit] ), [MTBF] )

 

This should give you the values in your second table.

 

I'm not sure how meaningful these numbers are. I'd probably use a weighted average like this:

DISTINCTCOUNT ( Service_Report[Unit] ) * [NumDaysInDateRange] / [NumSROs]

 

View solution in original post

6 REPLIES 6
parry2k
Super User
Super User

@mbailey try this measure

 

AVERAGEX ( VALUES ( Table[Partner ), [MTBF Measure] )

 

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

mbailey
Helper II
Helper II

Let me try presenting this again. My source data table would look like this below - Multiple Units assigned to Multiple Partners and the number of days (minus weekends and holidays) determined by a Date slicer. The number of Days in the Range will of course change as the Date range is changed.

 

My Measures are these: 

MTBF = ([NumDaysInDateRange]/[NumSROs])

NumSROs = DISTINCTCOUNT(Service_Report[sro_num])
NumDaysInDateRange = COUNT('DMTA_CalendarTable'[Date])

 

 

mbailey_1-1633458510916.png

I need to create another Visual table that will show the Average MTBF for each Partner within the same Date range. It would look like this:

 

mbailey_3-1633459181248.png

 

Any suggestions?

 

Thanks,

Mike Bailey

 

Does what I suggested not work for averaging over units?

 

AvgPerUnit = AVERAGEX ( VALUES ( Table1[Unit] ), [MTBF] )

 

This should give you the values in your second table.

 

I'm not sure how meaningful these numbers are. I'd probably use a weighted average like this:

DISTINCTCOUNT ( Service_Report[Unit] ) * [NumDaysInDateRange] / [NumSROs]

 

mbailey
Helper II
Helper II

It's the average per Partner as I explained in my post. In the table shown, there are multiple Units per Partner, and I'm calcing the MTBF using the formula above for each Unit per Partner. So, if Parnert Mike had MTBF's of 128, 114, 85, and 92, I'd want to return 104.75 for his Average MTBF.  The thing is, that depending on the date range selected in a Date slicer, the number of Units will change, so I need to always calc the average using the MTBF's shown in the filtered table above.

AlexisOlson
Super User
Super User

It's not clear if you want average per unit or average per customer or something else but the general pattern is like this

AvgPerField = AVERAGEX ( VALUES ( Table1[Field] ), [MTBF] )

 

parry2k
Super User
Super User

@mbailey average MTBF by what?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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