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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Syndicate_Admin
Administrator
Administrator

Cumulative Total Per Hour

Hello again

Sorry for the inconvenience, I have another question, I have a total of consultations in a period of one month, let's say 1000, however, at the end of that time, I need to know how many consultations were closed at 8 in the morning?, how many at 9 am., plus those at 8 am?, How many at 10 am, considering the one at 9am and the one at 8am? and so on every hour until 8 p.m. and represent them on a bar chart.

Does anyone have any suggestions?

In advance I thank you for your attention

Best regards

In advance thank you very much

Best regards

8 REPLIES 8
v-xiaotang
Community Support
Community Support

Hi @Syndicate_Admin @Adee_7 

You can create a measure to filter the table in a time period and then count the rows,

e.g.

measure= 

  var _timeStart= use function to get your time start

  var _timeEnd= use function to get your time end

return

  calculate(countrow('table'),filter(all('table'),'table'[time]<= _timeEnd && 'table'[time]>= _timeStart))

 

Best Regards,

Community Support Team _Tang

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

Good afternoon, I am trying to implement the solution they are providing me but I do not understand very well this part, where they tell me:

var _timeStart= use the function to get your time started

var _timeEnd= use the function to get the end of your time

Could you explain to me what functions are you referring to? o How can I create them? I as I tell you I have a catalog of the hours between 8 in the morning and 20:00 hrs but I do not understand very well How can I call it through a function? I hope you can support me with that. In advance I thank you infinitely

Best regards

Hi @Syndicate_Admin  @Adee_7 

The function needs to be customized according to your model.

Usually we need information below, could you provide it? Thanks

 (1) a sample file, you can replace raw data with bogus data to protect your privacy.

     or provide some sample data that fully covers your issue/question.

(2) give your expected result based on the sample you provide.

Kindly note: Please ensure the data in sample is concise and representative.

Thanks.

 

 

Best Regards,

Community Support Team _Tang

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

Hello!!

I generated the file, but when I try to upload it it sends me this error:

Adee_7_0-1645124164541.png

Can you tell me how can I share them?

The other way I came up with is by taking screenshots...

These are my data:

Adee_7_1-1645124363087.png

My lookup table

Adee_7_2-1645124400908.png

My Catalog of hours

Adee_7_3-1645124445699.png

How to show my cumulative closing agreement with the range of hours (this I generated manually, for the example)

Adee_7_4-1645124602242.png

As you can see my graph (All the hours mark me 13, because it is the total of queries I have, but it does not report the cumulative sum of closures per day)

As you should see... Increasing from 0 which is how you start the account to 13 which is the total of my queries

Thank you very much for everything, I am attentive to your comments

Best regards

amitchandak
Super User
Super User

@Syndicate_Admin , Create a date time in your table with hour only

 

date hour = datevalue([Datetime]) +time( hour([Datetime]),0,0)

 

then a measure like

calculate(sum(Table[value]), filter(allselected(Table[Datehour]), Table[datehour]<= max(Table[Datehour]) ) )

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Refers to Create a table,

ENilox_0-1671508934235.png
You will create a table like this.

ENilox_1-1671509008657.png

Then you have to format the Column (hours).

ENilox_2-1671509068031.png

After that you will be ready to create the measurement.


AcumHoras =
WHERE CALCULATE =
CALCULATE(
COUNTROWS(
TablaX
)
,FILTER(ALL(TablaX)
,TablaX[Time] <= .MAX(TablaHoras[Hours])
)
)
RETURN CALCULATE

Slds.

Thank you for answering me @Syndicate_Admin, I have been trying to implement it, but there is something that I do not understand very well, you tell me that I have to create a table with the date and from there extract the time, I in the information I have, I have a column where the closing hours are. At the time of applying the code I would have something similar to this:

Acumulado = CALCULATE(SUM('consultas consultas[statuscerrados]), FILTER(ALL('consultas consultas'),'consultas consultas'[hora_cierre] <= max ('consultas consultas'[hora_cierre])))

If I put it in my graph everything gives me 1 😥 and well that is not the correct result, for example between 9 and 10, there should be 647

In advance thank you very much

Hello, sorry for the inconvenience, will anyone have any news with the latest I said?

In advance thank you very much

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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