CTR, CPC and CPM: ad metrics with formulas and DAX

How the ad metrics click-through rate, cost per click and cost per thousand impressions are calculated, how they connect (CPC = CPM / (1000 × CTR)), cost per acquisition, a worked campaign example, the DAX on ad platform exports, and why they must be summed before they are divided.

Short answer: CTR (click-through rate) = clicks / impressions. CPC (cost per click) = spend / clicks. CPM (cost per mille) = spend / impressions × 1,000. They are linked: CPC = CPM / (1,000 × CTR), so a better CTR at the same CPM makes each click cheaper. Add CPA (cost per acquisition) = spend / conversions to reach the outcome. In DAX, sum spend, clicks and impressions first and divide the totals; never average the platform's daily CTR or CPC.

These metrics diagnose ads: CPM is the price of attention, CTR whether the ad is interesting, CPC the price of a visit, and CPA what an order costs.

How are they calculated?

AdImpressionsClicksSpendConversionsCTRCPCCPMCPA
Video A400,0004,8002,400961.20%0.506.0025.00
Image B250,0001,5001,500450.60%1.006.0033.33
Total650,0006,3003,9001410.97%0.626.0027.66
Two ads, one week

Both ads cost the same per thousand impressions (CPM 6.00), but Video A's double CTR halves its CPC: 6.00 / (1,000 × 1.2%) = 0.50.

CPMthe price of reaching people: audience, season, competition
CTRwhether the ad makes people click: creative, message, targeting fit
CPCthe price of a visit: CPM divided by CTR
CPAthe price of an outcome: CPC divided by the landing page's conversion rate
What each metric diagnoses

What is the DAX?

Impressions = SUM ( Ads[Impressions] )
Clicks = SUM ( Ads[Clicks] )
Ad Spend = SUM ( Ads[Spend] )
Conversions = SUM ( Ads[Conversions] )

CTR = DIVIDE ( [Clicks], [Impressions] )
CPC = DIVIDE ( [Ad Spend], [Clicks] )
CPM = DIVIDE ( [Ad Spend], [Impressions] ) * 1000
CPA = DIVIDE ( [Ad Spend], [Conversions] )
Click to Conversion % = DIVIDE ( [Conversions], [Clicks] )

Load the platforms' exports into one Ads table with the same columns (Date, Platform, Campaign, Ad, Impressions, Clicks, Spend, Conversions), converting currencies on the way in. All totals then work across platforms.

Why must you divide totals?

DayImpressionsClicksDaily CTR
Mon100,0001,0001.0%
Tue10,0003003.0%
Average of daily CTR2.0%
Total clicks / total impressions110,0001,3001.18%
Averaging CTR goes wrong

A quiet day counts as much as a busy one in an average of rates. Measures that sum first and divide last are always right, at every level.

What goes wrong?

  • Averaging platform rates. Sum, then divide.
  • Different click definitions. Link clicks, all clicks, outbound clicks; pick one per platform.
  • Different conversion counts. Each platform attributes its own; compare with your orders (see ROAS).
  • CTR as the goal. A clickbait ad wins on CTR and loses on CPA; judge by CPA or ROAS.

Where can you check this?

Where do you start?

Append all ad platforms into one table and build the five measures; then sort ads by CPA. Cost per lead and MQL to SQL continues the funnel for B2B.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.