Forum Discussion

DekkerNick's avatar
DekkerNick
Frequent Visitor
2 years ago
Solved

Clickable phone numbers PowerBI

Hi All,  in PowerBI, I have a table in which I want to have the value to be clickable phone numbers.   To achieve this, I followed the instruction in link below but does not seem to work u...
  • dk_dk's avatar
    2 years ago

    Hi DekkerNick ,

    Very interesting use case.

    I am not sure if my solution is viable, and I can only test it halfway, but maybe it works.

    You would need to have your own website and a little bit of JavaScript knowledge for this.


    In Power BI:
    You can create a measure that looks like:

    Call = "https://www.google.com/search?q=" & MAX(Phone[Number])

    Format it as Web URL. This example would open google and use the phone number as the parameter for the search term. This will be clickable and will open from power bi visuals.

    Instead of using Google, you would need to use your own web domain, and pass the phone number as a parameter.

    Then on your website, you can implement some js to grab the parameter value from the URL and open a new window with "tel:"+parameter value, which would initiate a call in the default program.

    I am no JS person, but Copilot suggests something like this. Please be aware this is AI generated code. If you want to explore this solution further, I suggest you find someone knowledgable in javascript to help you if needed.

    <!DOCTYPE html>
    <html>
    <body>
    
    <script>
        var params = new URLSearchParams(window.location.search);
        var number = params.get('number');
        window.location.href = "tel:" + number;
    </script>
    
    </body>
    </html>


    Its pretty over the top for something so simple but it could work....


    I tried to implement a css based approach with the HTML5 content visual, but for some reason it does not recognise the "tel:12345678" format as a valid URL, so Power BI refuses to open the browser for it.


    Hope you find a solution, curious to see what others can recommend! 

    Best regards,
    Daniel

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi DekkerNick 

     

    Thanks for the reply from dk_dk .

     

    DekkerNick , the following is for your reference:

     

    The following operations assume that a URL column exists in the data.

     

     

     

     

    Output:

    For more details, you can read related document link:https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-hyperlinks-in-tables?tabs=powerbi-desktop#create-a-column-with-a-hyperlink 

     

    Best Regards,
    Yulia Xu

     

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