Forum Discussion

ashmitp869's avatar
ashmitp869
Icon for Responsive Resident rankResponsive Resident
1 year ago
Solved

URL Link Color - Blue to Purple/Black

Hi ,
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.




So that the user can identify which has been checked , and which is left for clicking

 

 

  • 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

     

7 Replies

  • Hello ashmitp869 

     

    Try this DAX for CF

    LinkColor =

    SWITCH(

        TRUE(),

        ISBLANK('Table'[Approved Date]), "#FF0000",   // Red for missing approval

        'Table'[Approved Date] <= TODAY(), "#800080", // Purple if approved

        "#000000"                                     // Black by default

    )

    Thanks,
     Pankaj Namekar | LinkedIn

    If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

    • ashmitp869's avatar
      ashmitp869
      Icon for Responsive Resident rankResponsive Resident

      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

      • pankajnamekar25's avatar
        pankajnamekar25
        Icon for Super User rankSuper User

        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

        1. Relationship

        Create a relationship between Main Table[Report Name] and Click Log[Report Name]

        1. 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

        1. 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.

  • v-dineshya's avatar
    v-dineshya
    Icon for Community Support rankCommunity Support

    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

     

    • v-dineshya's avatar
      v-dineshya
      Icon for Community Support rankCommunity Support

      Hi ashmitp869 ,

       

      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

      • v-dineshya's avatar
        v-dineshya
        Icon for Community Support rankCommunity Support

        Hi @ashmitp869 ,

         

        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