Forum Discussion
Novice_YVR
3 years agoRegular Visitor
Running minimum within date ranges
Hi everyone, I am trying to figure out how to calculate a running minimum value within certain timeframes. Let's say I am working with the data below. For each "Account", I need to calculate ...
Jihwan_Kim
Super User
3 years agoHi,
Please check the below picture and the attached pbix file.
It is for creating a new column, not a measure.
Minimum within last 5 days CC =
VAR _t =
WINDOW (
-4,
REL,
0,
REL,
SUMMARIZE ( Data, Data[Date], Data[Account], Data[Value] ),
ORDERBY ( Data[Date], ASC ),
,
PARTITIONBY ( Data[Account] )
)
VAR _condition =
COUNTROWS ( _t ) = 5
RETURN
IF ( _condition, MINX ( _t, Data[Value] ), 0 )