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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
smpa01
Community Champion
Community Champion

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: Live Sound
• Beautiful News: Women in Parliament, Energy Mix, Shrinking Armies
• Visual Capitalist: Working Hrs
• Others: Easing Graph, Animated Calendar
MayViz Submissions
• Week 1: View
• Week 2: View
• Week 3: View
• Week 4: View
========================
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

smpa01
Community Champion
Community Champion

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: Live Sound
• Beautiful News: Women in Parliament, Energy Mix, Shrinking Armies
• Visual Capitalist: Working Hrs
• Others: Easing Graph, Animated Calendar
MayViz Submissions
• Week 1: View
• Week 2: View
• Week 3: View
• Week 4: View
========================

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

smpa01
Community Champion
Community Champion

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: Live Sound
• Beautiful News: Women in Parliament, Energy Mix, Shrinking Armies
• Visual Capitalist: Working Hrs
• Others: Easing Graph, Animated Calendar
MayViz Submissions
• Week 1: View
• Week 2: View
• Week 3: View
• Week 4: View
========================

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"
      }
    }
  }
}
smpa01
Community Champion
Community Champion

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: Live Sound
• Beautiful News: Women in Parliament, Energy Mix, Shrinking Armies
• Visual Capitalist: Working Hrs
• Others: Easing Graph, Animated Calendar
MayViz Submissions
• Week 1: View
• Week 2: View
• Week 3: View
• Week 4: View
========================

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.

smpa01
Community Champion
Community Champion

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: Live Sound
• Beautiful News: Women in Parliament, Energy Mix, Shrinking Armies
• Visual Capitalist: Working Hrs
• Others: Easing Graph, Animated Calendar
MayViz Submissions
• Week 1: View
• Week 2: View
• Week 3: View
• Week 4: View
========================

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.