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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
hsiddiq
Frequent Visitor

Direct Query - WorkQueue / WorkQueueItems

Hi team, if anyone can help me on this.

 

In my dashboard, I have workqueue and workqueueitem Dataverse tables conencted via a Direct Query.


Trying to Count (sum) of all the WorkQueueItemID

where Statecode = 2

CompeltedOn in the Last 60 mins.

Challenge, 
The CompeltedOn (datetime) is showing in UTC, I have already got CurrentTimeStampSydney which I can use as Now() time.
in a directQuery how can I convert CompletedOn to AUST time and then check how many are in this status for last 60 mins? 

I've tried 
timeDifferent without any conversion, but failing to get the SUM/Count. 
Not sure where my query is going wrong.


1. workqueueitem[compeltedon] >= Now() + Time(0,60,0)
2. TimeDifference (workqueueitem[compeltedon] - Now() + Time(0,60,0))

Processed_last60min =
 CALCULATE(
    COUNT('workqueueitem'[workqueueitemid]),
    workqueueitem[statecode] = 2,
    //createdOn  in the last 60 mins
 )
2 ACCEPTED SOLUTIONS
AnkitKukreja
Super User
Super User

Hi! @hsiddiq 

Try this CompletedOn = Table1[CompletedOn] + TIME(10, 0, 0)

 

 

For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904

View solution in original post

Anonymous
Not applicable

Hi @hsiddiq ,

 

Thank you for reaching out. I understand you are trying to count the WorkQueueItemID where Statecode = 2 and CompletedOn is within the last 60 minutes, but you are facing challenges with the datetime conversion from UTC to AEST.

 

Firstly, I would like to ask if the suggestion provided by another user helped resolve your issue.

For counting calculation, you could try:

Processed_last60min =
CALCULATE(
    COUNT('workqueueitem'[workqueueitemid]),
    'workqueueitem'[statecode] = 2,
    'workqueueitem'[completedon] >= (CurrentTimeStampSydney - TIME(1, 0, 0))
)

 

If the issue persists, could you please provide some sample data and the expected results? This will help us better understand the problem and provide a more accurate solution.

 

Best Regards,

Stephen Tao

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @hsiddiq ,

 

Thank you for reaching out. I understand you are trying to count the WorkQueueItemID where Statecode = 2 and CompletedOn is within the last 60 minutes, but you are facing challenges with the datetime conversion from UTC to AEST.

 

Firstly, I would like to ask if the suggestion provided by another user helped resolve your issue.

For counting calculation, you could try:

Processed_last60min =
CALCULATE(
    COUNT('workqueueitem'[workqueueitemid]),
    'workqueueitem'[statecode] = 2,
    'workqueueitem'[completedon] >= (CurrentTimeStampSydney - TIME(1, 0, 0))
)

 

If the issue persists, could you please provide some sample data and the expected results? This will help us better understand the problem and provide a more accurate solution.

 

Best Regards,

Stephen Tao

 

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

 

 

AnkitKukreja
Super User
Super User

Hi! @hsiddiq 

Try this CompletedOn = Table1[CompletedOn] + TIME(10, 0, 0)

 

 

For Power BI trainings or support dm or reach out to me on LinkedIn.
If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.