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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
norrisc
New Member

How to deal with 5 minute intervals that are cumulative?

I have light data going back a few years, with 5-minute intervals. My problem is that it is cumulative, so if I sum up the daily total I get a huge number. It resets to 0 each day.

 

Light data.jpg

 

I'm new with power BI, but I think the best solution would be to have a column or measure that is subtracting the top row from the bottom. Do you agree? If so, how can I do that?

5 REPLIES 5
norrisc
New Member

@CahabaData @SivaMani

 

Apologies.  If you look at the 2nd row in my screenshot there - I want the output to be 8 (791-783)

I'm struggling to do this in Power BI!

you would want to use the LOOKUPVALUE function, and as it seems you don't have an index column - the basis for look up would be the date/time less 5 minutes

 

 

www.CahabaData.com

Hi @norrisc,

 

First of all I added an Index column (named Ind) to the data and then I created this column with this formula ( I called my table DataFin:

 

PrevCDT =
VAR CDTPrev =
    SUMX (
        FILTER ( DataFin, EARLIER ( DataFin[Ind] ) = DataFin[Ind] + 1 ),
        DataFin[CDT]
    )
RETURN
    IF ( ISBLANK ( CDTPrev ), BLANK (), DataFin[CDT] - CDTPrev )

You can see my outcomes below:

Results.png

CahabaData
Memorable Member
Memorable Member

Your post is not clear.  If you refer to the field Cumulative Daily Light - then rather than sum perhaps you wish to take the difference between the first and last row/record.

 

 

www.CahabaData.com
SivaMani
Resident Rockstar
Resident Rockstar

Hi @norrisc,

 

What is your expected output?

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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