Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I'm pulling data from Google Analytics, specifically Event Action (a dimension) and Total Events (a metric). Event Actions are either a Click or an Impression (both strings). I would like to calculate the Click-Through-Rate (Click/Impression) using DAX.
Similar to this but in Power BI: https://www.youtube.com/watch?v=YtoItmFC8Gk
It would look something like this: SUM('Google Data'[Total Events] WHERE 'Google Data'[Event Action] = "Click" / SUM('Google Data'[Total Events] WHERE 'Google Data'[Event Action] = "Impression". Can someone please help with the correct DAX syntax.
Solved! Go to Solution.
@jytech you can use this DAX. Let me know if it has any issues, mean time if you can share sample data it would be easy to provide much more clear solution.
VAR Clickevents = CALCULATE(SUM('Google Data'[Total Events]), 'Google Data'[Event Action] = "Click")
VAR impevents = CALCULATE(SUM('Google Data'[Total Events]),'Google Data'[Event Action] = "Impression")
RETURN
Divide ( Clickevents,impevents,0)
Proud to be a Super User!
You are Welcome , also share your Kuods by pressing 👍 Icon!
Proud to be a Super User!
@jytech you can use this DAX. Let me know if it has any issues, mean time if you can share sample data it would be easy to provide much more clear solution.
VAR Clickevents = CALCULATE(SUM('Google Data'[Total Events]), 'Google Data'[Event Action] = "Click")
VAR impevents = CALCULATE(SUM('Google Data'[Total Events]),'Google Data'[Event Action] = "Impression")
RETURN
Divide ( Clickevents,impevents,0)
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
96 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |