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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
jppv20
Solution Sage
Solution Sage

Count records in previous time interval - Direct query mode

Hi,

 

My table visual looks like this (Where "Count id" is a count of the records in that time interval and "Count id -5" should be a measure):

 

jppv20_0-1682517483732.png

 

What I need is the count of ids for the previous interval. Expected output for "Count id -5":

IntervalCount idCount id -5
4/23/2023 12:05:00 AM343251
4/23/2023 12:10:00 AM291343
4/23/2023 12:15:00 AM241291
4/23/2023 12:20:00 AM241241
4/23/2023 12:25:00 AM254241
4/23/2023 12:30:00 AM239254

 

Hope someone can help me out, thanks in advance!

 

Best,

1 ACCEPTED SOLUTION
Alf94
Super User
Super User

Hi @jppv20,

 

Can you try the following?

 

Count ID - 5 = 
    CALCULATE(
        [Count Id],
        OFFSET(
            -1,
            ,
            ORDERBY( Table[Interval], ASC )
        )
    )

 

If I answered your question, please mark my post as a solution.

 

Best,

View solution in original post

1 REPLY 1
Alf94
Super User
Super User

Hi @jppv20,

 

Can you try the following?

 

Count ID - 5 = 
    CALCULATE(
        [Count Id],
        OFFSET(
            -1,
            ,
            ORDERBY( Table[Interval], ASC )
        )
    )

 

If I answered your question, please mark my post as a solution.

 

Best,

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.