Forum Discussion

Alta88's avatar
Alta88
Helper IV
4 years ago
Solved

Adding Hyperlinks to a Table

We send out daily reports to another team so the managers can relay any errors cited during our audits. The trouble is, the IDs to the accounts we review are dead - they can't take the user back to the website where they were built. How do I get these IDs to become clickable links within the table? 

 

 

  • You can create a measure that builds the URL to use.  In my example I have one that builds a URL to the nih.gov site using a drug code.

    Drug Search NIH =
    VAR _DrugCode = SELECTEDVALUE ( vDRUGCODE[Drug_Code] )
    RETURN
    IF ( NOT ISBLANK ( _DrugCode ),
    "https://mor.nlm.nih.gov/RxNav/search?searchBy=NDC&searchTerm="& _DrugCode)

    Then you use conditional formatting on the field and set this as the Web URL.

    That will make it a clickable link in the report:

     

     

10 Replies

  • You can create a measure that builds the URL to use.  In my example I have one that builds a URL to the nih.gov site using a drug code.

    Drug Search NIH =
    VAR _DrugCode = SELECTEDVALUE ( vDRUGCODE[Drug_Code] )
    RETURN
    IF ( NOT ISBLANK ( _DrugCode ),
    "https://mor.nlm.nih.gov/RxNav/search?searchBy=NDC&searchTerm="& _DrugCode)

    Then you use conditional formatting on the field and set this as the Web URL.

    That will make it a clickable link in the report:

     

     

  • jdbuchanan71 Thanks so much! This is super helpful -- so I plugged in the new measure but for some odd reason when I go to Conditional Formatting I don't have the Web URL option. Is there a way around this? 

     

     

     

     

    • Alta88's avatar
      Alta88
      Helper IV

      I'm not sure I understand. I had the table visual open when I clicked in the fields to select Conditional Formatting. Please advise. 

  • There are 2 'grid' visuals in PowerBI, Table and Matrix.  Conditinal formatting can only be applied to the values section of a matrix so I just wanted to point that out. Are you using a Table or a Matrix?

     

  • I can't fugure out why the 'Web URL' conditional formatting option is not appearing for you.  It is there for me on field types of text or date/time so it's not that.  It's there even before I create a url measure.
    If you create a new blank report and pull in some of the same data is the option available in the new one?  It seems there is a bug that can pop up in certain files.

    https://community.powerbi.com/t5/Desktop/Web-Url-Conditional-Formatting-Unable-to-Select-Field/td-p/1825825

     

  • Yeah, it's really weird. So I opened a new report and added data to a new table and the option finally showed up: 

     

     

    Something must be wrong with that specific file then. How do I get bugs out of a file? I don't want to build that report from scratch since we send it out daily.

  • If you add a new page to your old file can you do hyperlinks on the new page?  Maybe only have to rebuild the one.

  • So I tried that too, but no luck. This is very bizarre.