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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Getting the total of values pushed during the last 5 mins in a datastream

My data only contains one column pertaining to the insertion time: LastItemUpdateDate, and i wish to visualize in a card the total values (ReceiptCount) pushed during the last 5 mins, as such i created a measure that returns the number of values if the difference between that column and now is less than 5 mins and 0 otherwise :

ReceiptCountLast5min = Var d=Combinaison[diffhour] Var m=Combinaison[diffminute] Return If ((d<3) &&(m<5)  ; Sum(Combinaison[ReceiptCount]);0)

with : 

diffhour =
VAR d= ABS(DATEDIFF(Combinaison[current_time]; MAX(Combinaison[LastItemUpdateDate]); HOUR ))
RETURN d
and :
diffminute =
VAR d= ABS(DATEDIFF(Combinaison[current_time]; MAX(Combinaison[LastItemUpdateDate]); MINUTE ))
RETURN d

However i can't aggregated this measure to get the total of values inserted during the last 5 mins.

Also I can't filter the visual using diffminute of any other measure in that regard.

NB1:  As i'm working with datastreams i can't transform the data by creating calculated columns.

NB2:  I also tried the following to no avail : ReceiptCountInLast5min = CALCULATE(COUNT(Combinaison[ReceiptCount]);Combinaison[ReceiptInLast5min]="1")

3 REPLIES 3
v-xicai
Community Support
Community Support

Hi   @Anonymous ,

 

Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards

Amy

v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

Your data source is Streaming dataset, right? Currently, the streaming datasets do not support filtering. See more:Real-time streaming in Power BI .

 

In addition, what does the Combinaison[ReceiptInLast5min] in your formula below look like? Confused to distinguish your measure or column now.

 

>>ReceiptCountInLast5min = CALCULATE(COUNT(Combinaison[ReceiptCount]);Combinaison[ReceiptInLast5min]="1")

 

Or could you please share your sample data and desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.

 

Please read this post to get your answer quickly: How to Get Your Question Answered Quickly

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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

MFelix
Super User
Super User

Hi @Anonymous ,

 

You need to use an aggregator function (the ones that end with X) in order get the sum value by value that correspond to your calculation however I have a doubt regarding your requirements you talk about the sum of ReceiptCount but you use a SUM and a COUNT on your examples.

 

Do you want to count or sum the values of the receipt count?

 

If it's the sum then you need to use SUMX if it's a count can be COUNTX or COUNTROWS this two have to be used in tables with the filtering of the receiptcountlast5minutes you created.

 

Can you share some sample data please?


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors