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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Previous Value on row is wrong and is can't get per timestamp, only per day

Hi, I have a calculated column that should get the previous timestamp budget amount, however this is only showing the previous date, not timestamp, my usuage is then wrong, which makes my report show a total which is completely wrong, can anyone help with this?

Previous timestamp value is wrong on two dates, first 12/13/2018 and secondly on 1/2/2020

This is the column that is wrong and not always showing the previous value:

test.PNG

 

Usage since last ts is simply:

Usage Since Last TS = IF(NOT(ISBLANK('Table'[Previous TimeStamp Value])),
        'Table'[totalBudgetAmount] - 'Table'[Previous TimeStamp Value])
 
Thanks!
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , try both a new columns

Previous TimeStamp = maxx(filter(Table, [case id] =earlier([case id]) && [original Time Stamp] <earlier([original Time Stamp])),[original Time Stamp])

Previous TimeStamp Value= maxx(filter(Table, [case id] =earlier([case id]) && [original Time Stamp] =earlier([Previous TimeStamp])),[totalBudgetAmount])
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

 

1. Check the Data Type in Power Query . It should be Date Time.

2. Check whether any values are getting summarised by default in the pane. Make all as Don't Summarize.

 

You can use these measures too

 

Use these Measures:

 

Previous CaseId =
VAR a =
    MAX ( 'Table'[originalTimeStamp] )
VAR b =
    CALCULATE (
        MAX ( Table[caseId] ),
        FILTER (
            ALL (
                Table[CaseID],
                Table[originalTimeStamp],
                Table[totalBudgetAmount]
            ),
            Table[originalTimeStamp] < a
                && Table[CaseID]
                    MAX (  Table[CaseID] )
        )
    )
RETURN
    b



Previous DateStamp =
VAR a =
 MAX ( 'Table'[originalTimeStamp] )
VAR b =
CALCULATE (
MAX ( Table[originalTimeStamp] ),
 FILTER (
            ALL (
                Table[CaseID],
                Table[originalTimeStamp],
                Table[totalBudgetAmount]
            ),
            Table[originalTimeStamp] < a
                && Table[CaseID]
                    MAX (  Table[CaseID] )
)
)
RETURN
b

 

 

 

Previous Value2 =
VAR _previousDate = [Previous DateStamp]
VAR _previousCase = [Previous CaseId]
RETURN
    CALCULATE (
        MAX ( Table[totalBudgetAmount] ),
        FILTER (
            ALL ( Table),
           Table[originalTimeStamp] = _previousDate
                && Table[CaseID] = _previousCase
        )
    )

 

 

Regards,

Harsh Nathani

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

amitchandak
Super User
Super User

@Anonymous , try both a new columns

Previous TimeStamp = maxx(filter(Table, [case id] =earlier([case id]) && [original Time Stamp] <earlier([original Time Stamp])),[original Time Stamp])

Previous TimeStamp Value= maxx(filter(Table, [case id] =earlier([case id]) && [original Time Stamp] =earlier([Previous TimeStamp])),[totalBudgetAmount])
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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