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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Aeden
New Member

Translating time difference postgresql quries into DAX on a single table

Currenlty im running mutlple quries to return data in postgres, and then importing into PowerBI for the graphing, obvisouly many steps can be combined by connecting powerBI into the DB, and using DAX to calculate the coloumns rather seperate PG queries. 

to grab said data:
select *
from postgres

where requesttime is now() - interval '1 hour' 
(gives me everything in the last hour)

To split it further (in Postgresql) im using:

and notifytime < requesttime + interval '10 sec'
(to return things completed in under 10 seconds)

as well as:

and notifytime >= requesttime + interval '10 sec' and notifytime < requesttime + interval '30 sec'
(to find things that completed between 10 and 30 seconds)

What im struggling with is how to create the custom coloumn forumla for this 
notifytime >= requesttime + interval '10 sec' and notifytime < requesttime + interval '30 sec'


2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @Aeden 

Thanks for reaching out to us.

probably similar to this,

filter(table, table[requesttime]=NOW()-TIME(1,0,0))

However, the above is not complete, please share some sample data and expected results.

 

 

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.

That's something i looked at before however it doesnt compare two different coloumns which is where im struggling.

Result = notifytime is with X seconds of Requesttime
and
Result = notifytime more than X seconds of requesttime and also less than Y seconds of Requesttime

The data is just two coloumns of date/times, but rather than just a duration coloumn, im after multiple coloumns of certain duratons. 
So i can get a count of how many rows per requesttime got completed in a certain amount of time

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.