cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Re: How to show average hours on graph

Here is a working solution for you.  I created a measure that respects the current filter context and displays an average hours line.  I had to convert the hours to a decimal number first 

 

avg hours.png

 

here is the sample workbook https://www.dropbox.com/s/v8y46cw5bixolam/average%20hours.pbix?dl=1

 

Here is my measure

Average = CALCULATE(sum(Data[Decimal Hours])/DISTINCTCOUNT(Data[Date]),filter(all(Data[Date]),Data[Date] >=FIRSTDATE(Data[Date]) && Data[Date] <=LASTDATE(Data[Date])))

 

Here is the hour conversion (PQFL)

= Table.AddColumn(#"Extracted Time", "Decimal Hours", each Time.Hour([hour]) + Time.Minute([hour])/60)

 



* Matt is a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
tiagotas Regular Visitor
Regular Visitor

Re: How to show average hours on graph

I could not do the measurement, can you send me the file?

 

Or show me how your table is?

Highlighted
eduardo Regular Visitor
Regular Visitor

Re: How to show average hours on graph

@tiagotas

 

I think this video helps you.

 

 

abs

eduardo

Re: How to show average hours on graph


@tiagotas wrote:

I could not do the measurement, can you send me the file?

 

Or show me how your table is?


The file is linked in my earlier post. 



* Matt is a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (1,681)