Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
smpa01
Super User
Super User

TMSL equivalent in XMLA

Does XMLA has an equivalent of TMSL's createOrReplace?

 

I tried with Alter Element but it did not work.

 

@bcdobbs  @GilbertQ 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
10 REPLIES 10
GilbertQ
Super User
Super User

Hi @smpa01 

 

As @lbendlin said there is no XML format for the Semantic Models. They are stored in JSON or if using the newer format will now be TMSL.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

GilbertQ
Super User
Super User

If you script it out from SSMS it will be in the XML structure?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

ssms does not have any ALTER to script that is equivalent to TMSL's createOrReplace.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Please check further back in the thread. I provided just such an example. I selected an object and clicked the Script button.

That is not my requirement and lets not turn this into a XY problem.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

No, that produces JSON. However that works well enough, so I don't really see the need to insist on XML.

lbendlin
Super User
Super User

seems to be the same syntax.

 

{
  "createOrReplace": {
    "object": {
      "database": "Opportunity Field History",
      "table": "Opportunities",
      "partition": "2014"
    },
    "partition": {
      "name": "2014",
      "mode": "import",
      "source": {
        "type": "policyRange",
        "start": "2014-01-01T00:00:00",
        "end": "2015-01-01T00:00:00",
        "granularity": "year"
      }
    }
  }
}

This is TMSL, I am looking for XMLA

smpa01_0-1726693627964.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

I thought so too but you can use that as is in your XMLA calls.

 

lbendlin_0-1726695257748.png

 

Login-PowerBI
$XmlaQuery = @"
{
"refresh": {
"type": "automatic",
"applyRefreshPolicy": true,
"effectiveDate": "1/1/2024",
"objects": [
{
"database": "Analyze in Excel",
"table": "Details"
}
]
}
}
"@

# URL is a relative or absolute URL of the Power BI entity to access. 
$res=Invoke-PowerBIRestMethod -Url 'groups/xxx/datasets/yyy/refreshes' -Method Post -Body $XmlaQuery 

etc.

Thanks but I am looking for the XML structured query for xmla and not json structured query. Currently pq formatting in json structure is a pure nightmare (bism normalizer) , I need to see how the same appears in xml structure.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.