cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
MikeKKK
Frequent Visitor

Count link clicked within Power BI report

I am working on a Power BI report that contains a number links to other reports and files.   I would like to record number of clicks of each link when user clicks, within this Power BI report.

 

I understand that this cannot be done in PowerBI, but perhaps it could be done with PowerApps visual? 

 

Has anyone walked the path before? or have some showcases or example to share?

1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

Hi,   @MikeKKK 

 

Having no experience with Power App, the following case seems to fit your needs.

Count the number of times clicked

 

Create a table like this called CountOfClicks

URL TotalClicks
www.google.ca 23
www.arstechnica.com 4
www.reddit.com 34

 

Assuming the gallery holds the URL you could put this code in the OnSelect property of your button to track clicks

Set(currentRecord, LookUp(CountOfClicks, URL = ThisItem.Hyperlink));

If(
    IsBlank(currentRecord),
    //create a new record when URL is new and start at 1 click
    Patch(CountOfClicks, Defaults(), {URL = ThisItem.Hyperlink, Clicks: 1}),
    //add clicks to a record when URL already exists
    Patch(CountOfClicks, currentRecord, {Clicks: currentRecord.Clicks + 1})
)

 

 

Best Regards,
Community Support Team _ Zeon Zheng


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

5 REPLIES 5
tochizzle
New Member

@MikeKKK @v-angzheng-msft 

I am having same problem. Have you been able to resolve it in power apps

v-angzheng-msft
Community Support
Community Support

Hi,   @MikeKKK 

 

Having no experience with Power App, the following case seems to fit your needs.

Count the number of times clicked

 

Create a table like this called CountOfClicks

URL TotalClicks
www.google.ca 23
www.arstechnica.com 4
www.reddit.com 34

 

Assuming the gallery holds the URL you could put this code in the OnSelect property of your button to track clicks

Set(currentRecord, LookUp(CountOfClicks, URL = ThisItem.Hyperlink));

If(
    IsBlank(currentRecord),
    //create a new record when URL is new and start at 1 click
    Patch(CountOfClicks, Defaults(), {URL = ThisItem.Hyperlink, Clicks: 1}),
    //add clicks to a record when URL already exists
    Patch(CountOfClicks, currentRecord, {Clicks: currentRecord.Clicks + 1})
)

 

 

Best Regards,
Community Support Team _ Zeon Zheng


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Have anyone manage to get this working? I'm trying to apply it to Power BI but I'm having trouble on where to use it. is it on a the Dax measure? or Power Query? im probably asking the wrong question but I would appreciate if there's any direction or an instruction break down on how to apply this on Power BI?

Thanks.

Hi, @MikeKKK 

 

May I ask if the above post is helpful to you?

If  it does, could you please mark the post which help as Answered? It means a lot to me, and it will help the others in the community find the solution easily if they face the same problem with you. Thank you.😀

 

 

Best Regards,
Community Support Team _ Zeon Zheng

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors