cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
JRoot213
New Member

Measure Difference When Value = Value - 1

I have a measure, CRT, that is being displayed over an interval of every 30 minutes time. to make things easier I've attached an interval ID number that represents every 30 minutes of the day. 

 

I'm trying to measure the difference between the measure 30 minutes ago compared to the current time. I am coming up short. Currently I have the below attempt in DAX

CRT Difference =
VAR PrevCRT =
CALCULATE(IntraCRT[CRT],
FILTER(DAXIntervalID,
    DAXIntervalID[Value] = DAXIntervalID[Value] -1)
)
VAR CurrentCRT = IntraCRT[CRT]
RETURN
    PrevCRT - CurrentCRT
 
The outcome I receive for PrevCRT is blanks vs the CRT from 30 minutes prior. 
3 REPLIES 3
JRoot213
New Member

Thank you so much for the quick reply. 

 

Unfortunately that's giving me the same result.

 

JRoot213_0-1679625269949.png

 

CRT Difference =
VAR PrevCRT =
CALCULATE(IntraCRT[CRT],
FILTER(ALL(DAXIntervalID[Value]),
    DAXIntervalID[Value] = MAX(DAXIntervalID[Value]) -1)
)
VAR CurrentCRT = IntraCRT[CRT]
RETURN
    PrevCRT - CurrentCRT
wdx223_Daniel
Super User
Super User

CRT Difference =
VAR PrevCRT =
CALCULATE(IntraCRT[CRT],
FILTER(ALL(DAXIntervalID[Value]),
    DAXIntervalID[Value] = DAXIntervalID[Value] -1)
)
VAR CurrentCRT = IntraCRT[CRT]
RETURN
    PrevCRT - CurrentCRT

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors