Forum Discussion
danielhough
3 years agoHelper II
Carry Forward Values until Change
Hello everyone! I have a issue below that I am trying to resolve. I have daily rates in the below table. The rate for July, 1.14043 remains constant throught its next change on August 1, 1.55169. I n...
- 3 years ago
The method I posted was using measures.
If you want it as a calculated column, use:
Filled Value = VAR _LNB = CALCULATE ( MAX ( 'Table'[Date] ), FILTER ( 'Table', 'Table'[Date] <= EARLIER ( 'Table'[Date] ) && NOT ISBLANK ( 'Table'[Daily Rate] ) ) ) RETURN LOOKUPVALUE ( 'Table'[Daily Rate], 'Table'[Date], _LNB )
davehus
3 years agoMemorable Member
Hi danielhough , Are you able to sort the table in powerquery and use the fill down function to fill the null values?
Did I help you today? Please accept my solution and hit the Kudos button.
danielhough
3 years agoHelper II
Hey! So this is a calulcated table so I don't see it in Power Query, but I essentially need to fill "up" the numbers from old to new.
- davehus3 years agoMemorable Member
Maybe something like this might help?
https://community.powerbi.com/t5/Desktop/Find-next-value-by-date/td-p/503446
Did I help you today? Please accept my solution and hit the Kudos button.
- danielhough3 years agoHelper II
Heres the code I used and the result, am I not placing the variables correctly?
Column =VAR temp =TOPN (1,FILTER ( '3. RATES_TABLE_MMMF', [DAILY_RATE] = EARLIER ( [DAILY_RATE] ) && [Date] > EARLIER ( [Date] ) ),[Date], ASC)VAR result =MINX ( temp, [DAILY_RATE] )RETURNIF ( ISBLANK ( result ), [DAILY_RATE], result )