how much time do lipid tests measure?

pardon me if i have a tough time explaining this question... im curious how much time does a lipid test measure... like if youve changed your diet 6 months before or 3 months before will a lipid test be measuring that? as oppose to one week before... like if youve been a poor eater for years then one week before you want to have a good test and eat healthy will that affect the test?

**im not trying to trick a test btw lol... im a very healthy eater and fit and athletic. im just wondering if someone changes their diet how long should one wait to take a lipid test to see if it changes the results.

hope that makes sense.