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

AVERAGE measure produce error

Posted this earlier but a moderator thought it was spam... It isn't.

 

I have only just begun using Power BI and I'm following along with some YouTube videos. I thought I had a good grip, so would create a visual off of my own data, but I am stuck!

 

I have a spreadsheet with a number of columns in. The most interesting ones are labelled "Item ID" (a unique reference) and "Time to Accept" which is hh:mm:ss. I want a card to show me the average time to accept value across each of my rows. I've selected the "Item ID" field and the "Time to Accept" fields which has produced this table:

 

christianMDU_0-1652791411578.png

 

 

I've then clicked Home -> New measure and entered "Average Time to Accept = AVERAGE(Sheet[Time to Accept])" but now the visual displays an error "Can't display the visual":

 

christianMDU_1-1652791411003.png

 

 

 

When I click "See details", here's what I see:

 

christianMDU_2-1652791411147.png

 

 

1 ACCEPTED SOLUTION

You can't use the Time datatype. You have to use DURATION.

View solution in original post

14 REPLIES 14
v-rongtiep-msft
Community Support
Community Support

Hi @christianMDU ,

Could you please tell me have you solve your issue now? If so ,please kindly provide the solution and mark your reply. If not, please provide your pbix file without privacy information and desired output with more details.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

SpartaBI
Community Champion
Community Champion

@christianMDU that means the data type of the column is text.
Change the data type to time in Power Query and close and apply.



2022-05-09 22_36_04-Power BI Workspace Datasets License Permissions - Microsoft Power BI Community.png

Showcase Report – Contoso By SpartaBI


SpartaBI_3-1652115470761.png  SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Full-Logo11.png

Hi, thanks for the quick response. I changed the data type to "Time" but forgot to save/apply it. I've gone to redo it but now it's complaining that it cannot automatically convert the column:

 

christianMDU_0-1652792130246.png

 

@christianMDU can you start from scratch and update me you still get the error?

I deleted the measure and restarted Power BI Desktop but am still getting the error.

You do that in power query?

Can you share your model?

Sorry, I was doing this in the "Data" panel:

 

christianMDU_0-1652793190592.png

 

 

When I open "Transform data", I went into the Transform tab and changed the Data Type to "Time" there:

 

christianMDU_4-1652793504592.png

 

This seems to have worked, but now I have another problem as the values say "Error":

 

christianMDU_2-1652793425268.png

 

 

Is there some sort of maximum figure? It should show 29:41:41 as per the yellow bar.

Don't think it can go above 23:59:59

Is there anything I can do to convert that to 1 day, 5 hours, 41 min and 41 sec, for example? 

You can't use the Time datatype. You have to use DURATION.

Thanks, that worked. It's giving me an average of "0.45" but Excel says it's 10:13:59 so I need to look at what else I've done wrong. I'm enjoying it though... 🙂

It's no wonder it says .45 (but I won't go deep into that). I believe you can format a duration datatype using the FORMAT function to turn it into the form [HH]:mm:ss.

@christianMDU ye sure, I'm just not near pc right now, but I hope someone will reply, there are multiple ways to do so. 

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.

Top Solution Authors