Forum Discussion

MarKha's avatar
MarKha
Frequent Visitor
3 years ago
Solved

Unable to access or open datamart

I created a datamart, but it stopped working after a few days. There is an error icont that reads:  Datamart is unavailable Unable to sync the datamart with the automatically generated dataset...
  • v-yueyunzh-msft's avatar
    3 years ago

    Hi , MarKha 

    Based on my research internally, this is a known issue for the Power Bi datamart feature and the engineers are trying to figure out the root cause and fix it asap, meanwhile, you can kindly follow this list of steps to get the M query information from the broken unavailable datamart and create a new one with the same M query to keep using the new one and check if it can be used normally after then:

    Datamart schema consists of the following:

    Dataflow definition
    Dataset definition
    Database definition

     

    To get these, send a GET request to the following URI:

    https://<[baseUrl]>/v1.0/myorg/groups/<[groupId]>/datamarts/<[datamartId]>?$select=etl,xmla,views

     

    To get these values:

    1.Open 'Network' tab in developer tools for browser (by pressiong F12 key).
    2.Click on the unavailable datamart.
    3.It will show an error warning with 'Try again' button. Click on the button.
    4.Locate 'resumeSuspendedBatches' call. Get the values from the 'Request URL' field of 'Headers' tab.(You need to change the end of the URL string to“?$select=etl,xmla,views” at the end of this request URL as mentioned in the format of this GET request)
    5.For getting the auth token, under the 'Headers' tab, scroll down 'Request Headers' section. Copy the value of 'authorization' field (right click -> 'Copy value')

     

    Send request

    GET request can be sent through any tool that supports REST API. Example below is for Postman (https://www.postman.com/downloads/)

    1.Select GET
    2.Enter URL (as formed above)
    3.Under 'Authorization' tab, select 'Bearer Token' as type. Paste the value of the token in the field. NOTE that the token may have a keyword 'Bearer ' prepended to it. Remove this from the token.
    4.Hit 'Send'
    5.The response status should be 200 OK. The response data would be under 'Body' tab.

     

    Then you can copy the response value in yellow in above picture, open the notepad++(If you don’t have, you can download it as it’s free to use):

     

    To change the response format and generate the same queries within the original broken datamart, Press CTRL-h and the Replace dialog will open in notepad++. Select search mode "Extended" and replace \" with ", \\r\\n with \r\n and \\n with \n.

    Then you are meant to get the correct query format like this:

     

    Then you can create a new datamart and select the blank query as the datasource, you may need to add them one by one into the datamart to make it as the same as the original broken datamart, here's the step:

     

     

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

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