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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculate in determinated period time

Hello everybody,

 

I need help with a measure to calculate the number of custumers re-energized in the first 3 minutes from the start of the incident.

 

Basicaly i have a INCIDENT_ID, DATE/TIME and EVENT (filters columns) and Customers column (to sum).

 

For exemple:

 

In this case, the measure most to sum all custumers de-energized (red side "DES")  subtracting the re-energizeds (green side "ENER") both in first 3 minutes from the start of the incident. 

 

6750 - 2043 - 859 = 3848

ExempleExemple

 

DatabaseDatabase

 

 

Thank you all

2 REPLIES 2
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

How could you want to show your desired result and how could you make sure the first 3 minutes from the start of the incident?

For example, if your data like below, you could try to use this formula:

1.PNG

Measure = CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Legend]="DES"&&MINUTE('Table1'[Data])<=3))-
            CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Legend]="ENER"&&MINUTE('Table1'[Data])<=3))

Result:

1.PNG

If I misunderstand you, please offer me more information if possible.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-danhe-msft 

 

 I have to create this other account because i cant log in the other with organizational problem.
 
Thank you.
 
Actually, i need that the measure calculate "Sum(Des) - Sum(ener)" in a period of 3 minutes starting from the beginning of each incident.
 
In my exemple i filtered just 1 incident, so, in this case the measure have to calculate considering a period from first date/time (10/11/2018 15:01:55)  +3 minutes  (10/11/2018 15:04:55), ignoring everything that is not in this period. And reply this rule for any incident
 
For exemple:
 
10/11/2018 15:01:55 (first date/time)
10/11/2018 15:03:38 (consider)
10/11/2018 15:03:54 (consider)
10/11/2018 15:12:12 (NOT consider because > first date/time +3 minutes)
 
Then, in the considered period the measure have to calculate the Sum(Des) - Sum(Ener).
 
To make sure that the measure i'll consider this period for each incident, i think the measure have to filter each incident and consider the min(date/time)+3 to calculate the sums and subtract.
 
Thank you again.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors