Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Power Query Doesn't Recognize CommonDataService.Database

Hello,

 

I am trying to use NativeQuery for DataVerse following this documentation:
Power Query Dataverse connector - Power Query | Microsoft Learn

However, Power Query does not recognize CommonDataService.Database and is returning the following error:
Expression.Error: The name 'CommonDataService.Database' wasn't recognized. Make sure it's spelled correctly.

My code is as follows:
Source = CommonDataService.Database("<dataverse url>,5558", [CreateNavigationProperties=false]),

 

Thanks in advance!

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Anonymous,

    Thank you for reaching out in Microsoft Community Forum.

    The Dataverse.Database function is supported in Power BI Desktop September 2024 or later. Make sure you are using the latest version, as older versions may not include this functionality.

    Please continue using Microsoft community forum.

    If you found this post helpful, please consider marking it as "Accept as Solution" and give it a 'Kudos'. if it was helpful. help other members find it more easily.

    Regards,
    Pavan.

11 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

    Thank you for reaching out in Microsoft Community Forum.

    The error occurs because CommonDataService.Database is an outdated function name, and the correct function to use is Dataverse.Database. Microsoft rebranded Common Data Service (CDS) to Dataverse, and the function name changed accordingly.

    Please follow below steps to solve this error;

    1. Replace CommonDataService.Database with Dataverse.Database in your query.
    Source = Dataverse.Database("<dataverse url>,5558", [CreateNavigationProperties=false])

    2. Make sure you're using the latest version of Power Query and that your connector supports Dataverse.Database.

    3. Enable the Dataverse Connector
    In Power BI, go to File > Options and Settings > Options > Preview Features and check if Dataverse is enabled.

    Please continue using Microsoft community forum.

    If you found this post helpful, please consider marking it as "Accept as Solution" and give it a 'Kudos'. if it was helpful. help other members find it more easily.

    Regards,
    Pavan.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous,

      Thank you for reaching out in Microsoft Community Forum.

      Yes, Dataverse.Database does support Value.NativeQuery, which enables query folding for optimized performance and supports Incremental Refresh

      And please follow the below steps;

      1. Use Query Diagnostics or right-click a step in Power Query to verify if folding occurs.

      2. Make sure proper permissions for executing native queries and consider Dataverse API limitations.

      Please continue using Microsoft community forum.

      If you found this post helpful, please consider marking it as "Accept as Solution" and give it a 'Kudos'. if it was helpful. help other members find it more easily.

      Regards,
      Pavan.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Pavan,

        I tried the following in the Power Query Advanced Editor:
        let
            Source = Dataverse.Database("<dataverse url>", [CreateNavigationProperties=false])
        in
            Source

        and recieved the error message:
        Expression.Error: The name 'Dataverse.Database' wasn't recognized. Make sure it's spelled correctly.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

    I wanted to follow up since we haven't heard back from you regarding our last response. We hope your issue has been resolved.
    If the community member's answer your query, please mark it as "Accept as Solution" and select "Yes" if it was helpful.
    If you need any further assistance, feel free to reach out.

    Please continue using Microsoft community forum.

    Thank you,
    Pavan.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Pavan,

       

      I am currently unable to test the resolution as the required version of Power BI is not available at my organization.  In the interim I have removed Incremental Refresh from my report. Thank you for your assistance.

       

      All the best,

      Dave

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous,

        Thank you for reaching out in Microsoft Community Forum.

        As you mentioned, your organization uses an older version of Power BI. Please try updating to the latest version, as it will be beneficial. If my response answers your query, please "Accept as Solution" and also give "Kudos" so that community members facing a similar issue can find the solution quickly
        .

        Please continue using Microsoft community forum.

        Regards,
        Pavan.