Measure for Parameter in Tableau
First create a parameter with all the conditions similar to the one below.
Then create a Measure with the Case condition as shown below:
CASE [Parameters].[Choose Measure]
WHEN "video_views" THEN SUM([Video Views])
WHEN "reach" THEN SUM([Reach])
WHEN "spend" THEN SUM([Spend])
WHEN "inline_link_clicks" THEN SUM([Inline Link Clicks])
WHEN "Cost per Million" THEN ROUND(([Cost per Million]/10)*10,1)
WHEN "Cost per Purchase" THEN ROUND(([Cost per Purchase]/10)*10,1)
WHEN "Cost per Showtime Lookup" THEN ROUND(([Cost per Showtime Lookup]/10)*10,1)
WHEN "Cost per Visit" THEN ROUND(([Cost per Visit]/10)*10,1)
WHEN "Click-through Rate" THEN ROUND([Click-through Rate] * 100,1)
WHEN "Cost Per Complete" THEN ROUND(([Cost Per Complete]/10)*10,1)
WHEN "Engagement Rate" THEN ROUND([Engagement Rate] * 100,1)
WHEN "fb_pixel_purchase" THEN SUM([Fb Pixel Purchase])
WHEN "fb_pixel_purchase_unique" THEN SUM([fb_pixel_purchase_unique])
WHEN "Purchases Per Unique" THEN ROUND(([Ratio Purchases Per Unique]/10)*10,1)
WHEN "showtime_lookup" THEN SUM([showtime_lookup])
WHEN "showtime_lookup_unique" THEN SUM([showtime_lookup_unique])
WHEN "Showtimes Per Unique" THEN ROUND(([Ratio Showtimes Per Unique]/10)*10,1)
WHEN "Video Completion Rate" THEN ROUND([Video Completion Rate] * 100, 1)
WHEN "video_avg_time_watched" THEN SUM([Video Avg Time Watched])
WHEN "video_p100_watched_video_views" THEN SUM([Video P100 Watched Views])
WHEN "Relevance Score " THEN ROUND([Relevance Score ],0)
WHEN "Cost per unique purchase" THEN ROUND(([Cost per unique purchase]/10)*10,1)
WHEN "Cost per unique showtime" THEN ROUND(([Cost per unique showtime]/10)*10,1)
END
Comments
Post a Comment