Forum Discussion
URL Link Color - Blue to Purple/Black
- 1 year ago
Hi ashmitp869 ,
Thank you for reaching out to the Microsoft Community Forum.
Power BI does not support changing hyperlink colors based on whether a user has clicked them or not.
Here are a few possible alternatives:
Option 1: Use a Custom HTML Viewer Visual
Use a custom visual like HTML Content or HTML Viewer. You can write custom HTML with CSS styles like this:
html
<a href="https://example.com" target="_blank" style="color:blue">Click Me</a>
<style>
a:visited {
color: purple !important;
}
</style>Option 2: Simulate Click Tracking with DAX
You can simulate visited links by tracking clicks using a measure or flag in your data model: Create a column in your data model to track if a link has been clicked (IsVisited). Use conditional formatting in a table or matrix visual to change the color of the link text based on IsVisited.
Dax measure
LinkColor = IF([IsVisited] = TRUE, "Purple", "Blue")
Note: Then apply this color using conditional formatting on the text.
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
Hi pankajnamekar25
Sorry I missed to include at the beginning about the requirement which I editted now.
How can I change the Web URL link color from Blue to Purple/Black when clicked by user.
i.e
When I first open the report - the link should be blue.
Once the user click the report - it should change to Purple.
Can you revisit again about the query
Create a Click Log Table
Create a table to log when a user clicks a report (this part could be done manually, through Power Automate, or via Power App integration).
Report Name | Clicked Flag |
Sales Report | 1 |
Finance Report | 0 |
- Relationship
Create a relationship between Main Table[Report Name] and Click Log[Report Name]
- DAX Color Formatting Measure:
Link Color =
VAR IsClicked =
SELECTEDVALUE('Click Log'[Clicked Flag], 0)
RETURN
IF(IsClicked = 1, "#800080", "#0000FF") -- Purple if clicked, Blue if not
- Use Conditional Formatting
In your table or matrix visual, go to the URL column → click on Conditional Formatting → Font Color → choose “Format by field value” → select Link Color.
Thanks,
Pankaj Namekar | LinkedIn
If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.