Forum Discussion
Populate missing data using last populated row
Hi v-easonf-msft,
Thankyou for your reply, this works perfectly...almost!
I mentioned that there were blank RefNo's at the start of the run and this wasn't an issue however it seems i was wrong now i've impemented your suggestion. Once the count resets to 0 i'd like the RefNo to be remain blank (as it is currently bringing across the previous RefNo and this is altering some of my visuals incorrectly), however it would be perfect if the code could look forward and grab the next available RefNo once the 'Value' count resets to 0 and the RefNo is blank, if that's possible?
Many thanks,
Lewis
Hi, Lew_14
Not fully sure what your want. Is this the result you want?
If so, please modify the formula of 'Index (amended)' as below:
Index (amended) =
VAR a =
CALCULATE (
MAX ( 'Table 2'[Index] ),
FILTER (
'Table 2',
'Table 2'[Index] <= EARLIER ( 'Table 2'[Index] )
&& 'Table 2'[RefNo] <> BLANK ()
)
)
VAR b =
CALCULATE (
MIN ( 'Table 2'[Index] ),
FILTER (
'Table 2',
'Table 2'[Index] >= EARLIER ( 'Table 2'[Index] )
&& 'Table 2'[RefNo] <> BLANK ()
)
)
RETURN
IF (
ISBLANK ( 'Table 2'[RefNo] ),
IF ( 'Table 2'[Valuew] = 0, b, a ),
'Table 2'[Index]
)
Please check 'Table 2' in my attachment.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Lew_144 years agoFrequent Visitor
Apologies, it's a little tricky to explain! Once the value resets to 0 a new count will begin for the next production run however the count can sometimes climb (to 10, for example) before the RefNo is allocated. In these cases i need the calculation to look forward and grab the next RefNo but i think your suggestion only does this where the value is 0, if i'm correct?
I'm struggling to verify this as i'm receiving an error that there isn't enough available memory to add the amended index column. My table only has 20k rows and around 10 columns and i have 8GB RAM available so if there's anything you can think of to make the code more efficient that would be extremely helpful.
Many thanks
- v-easonf-msft4 years agoCommunity Support
Hi, Lew_14
Sorry, the question is a bit beyond my ability. I have no idea how to optimize this code of mine 😞.
I think there may be other more convenient ideas, but I haven't thought of it at the moment.
Best Regards,
Community Support Team _ Eason