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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Bolexle
New Member

Average of 4 options over Time

I am trying to create an average count where I have specific date spreads.

 

For now I have 3 relevant columns:

 

1 column has 4 different string options, for example, fruits: [apples, oranges, pears, bananas]

 

another is a start of hour tracker for said data,

 

and another is a data pulled timer, where data is pulled every 5 minutes.

So for an example table, you could have:

FruitsStartOfHourDataPulledTime
apple2019-06-03 10:00:00 AM2019-06-03 10:00:00 AM
orange2019-06-03 10:00:00 AM2019-06-03 10:05:00 AM
orange2019-06-03 10:00:00 AM2019-06-03 10:10:00 AM
banana2019-06-03 10:00:00 AM2019-06-03 10:05:00 AM
banana2019-06-03 10:00:00 AM2019-06-03 10:10:00 AM
banana2019-06-03 10:00:00 AM2019-06-03 10:10:00 AM

 

What I want to make is a bar graph that shows in hourly chunks, the average number of fruits. So for this piece of data, the expected outcome for the 10am hourly chunk would be:

 

.083 apples (only 1 apple was eaten in 12 update cycles, meaning  you only have on average 1/12th of an apple)

.16 oranges (1 orange eaten for 2 of the 5 minute cycles, none for the rest, so the average is .16)

.25 bananas(1 banana eaten 1 cycle, 2 eaten 1, and none the rest.)

 

Anyone have a good idea on how to implement this?

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@Bolexle ,

 

You may just try the measure below.

Measure =
DIVIDE ( COUNTROWS ( Table1 ), 12 )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@Bolexle ,

 

You may just try the measure below.

Measure =
DIVIDE ( COUNTROWS ( Table1 ), 12 )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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