Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
jytech
Helper I
Helper I

Calculate the Conversion Rate of Two Events in Google Analytics

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.

1 ACCEPTED SOLUTION
VijayP
Super User
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)




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


View solution in original post

3 REPLIES 3
VijayP
Super User
Super User

@jytech 

You are Welcome , also share your Kuods by pressing 👍 Icon! 




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


VijayP
Super User
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)




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


@VijayP thank you kind sir. It worked perfectly!

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.