To understand CPM, let's first understand what an impression is. 
 
Impressions refer to the number of times your ad were displayed on screen for your target audience. An impression is counted each time it appears on screen for the first time. 
 
For Example:
 
If an ad is on screen and someone scrolls down the page, and then scrolls back up to the same ad, that only counts as 1 impression. However, when someone sees an ad on screen in the morning, then leaves, and comes back in the afternoon and sees your ad again, that counts as 2 impressions. 
 
Cost Per 1,000 Impressions is the average cost for 1,000 impressions. It is a metric often used to compare performance among other different advertisers and campaigns. Typically, when CPM is high, it indicates that the competition for the same target audience is high as well, given that advertisers on Facebook are charged on a CPM basis. 
 
To calculate CPM, take the total ad spent divided by number of impressions, multiply by 1,000. 
 
CPM = (Total Ad Spent / Impressions) x 1,000