Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All,
I have a table which have Date tiem columns and a data columns. Consider column name 'high'
I want to compare recirds with the previous value on same column on the basis on datetime column.
The above is the sample ss of the data. How can i achive this?
Solved! Go to Solution.
Hi @sarvesh23p ,
Please try this code to create a measure.
Open Diff =
VAR _Previous_Datetime =
CALCULATE (
MAX ( 'Table'[Datetime] ),
FILTER ( ALL ( 'Table' ), 'Table'[Datetime] < MAX ( 'Table'[Datetime] ) )
)
VAR _Previous_value =
CALCULATE (
SUM ( 'Table'[Open] ),
FILTER ( ALL ( 'Table' ), 'Table'[Datetime] = _Previous_Datetime )
)
VAR _Current_value =
CALCULATE ( SUM ( 'Table'[Open] ) )
RETURN
_Current_value - _Previous_value
My Sample:
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @sarvesh23p ,
Please try this code to create a measure.
Open Diff =
VAR _Previous_Datetime =
CALCULATE (
MAX ( 'Table'[Datetime] ),
FILTER ( ALL ( 'Table' ), 'Table'[Datetime] < MAX ( 'Table'[Datetime] ) )
)
VAR _Previous_value =
CALCULATE (
SUM ( 'Table'[Open] ),
FILTER ( ALL ( 'Table' ), 'Table'[Datetime] = _Previous_Datetime )
)
VAR _Current_value =
CALCULATE ( SUM ( 'Table'[Open] ) )
RETURN
_Current_value - _Previous_value
My Sample:
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 58 | |
| 45 | |
| 42 | |
| 20 | |
| 18 |
| User | Count |
|---|---|
| 171 | |
| 110 | |
| 91 | |
| 55 | |
| 45 |