Forum Discussion
Update custom partition
- 1 year ago
Hi Peter_23,
Thank you for your follow up query. I apologize for any inconvenience you may have experienced.
As per the details provided previously, I have gone through the code again and made some small changed based on the requirement, so I request you to please try the below provided code if the issue persist, please feel free to reach out to us.
Code1:$updatedPartitionDefinition = @{
"createOrReplace" = @{
"object" = @{
"database" = "base"
"table" = "mytable"
"partition" = "BB"
}
"partition" = @{
"name" = "BB"
"source" = @{
"type" = "m"
"expression" = @(
"let",
"source = ...",
"#\Filtered Rows\"= Table.SelectRows(source, each [#\"Query-filter\"] = \"BB\")",
"in",
"FilteredRows"
)
}
}
}
}
Code2:
$refreshRequest = @{
"refresh" = @{
"type" = "dataOnly"
"objects" = @(
@{
"database" = "base"
"table" = "mytable"
"partition" = "BB"
}
)
}
}
If you have any further queries please feel free to reach out to us we will guide you accordingly. If this post helps, then please give us 'Kudos' and consider Accept it as a solution to help the other members find it more quickly.
Thank you.
Hi Peter_23
To pass a custom parameter (key) in a TMSL script:
- Define the parameter in the Tabular Model (SM) settings.
- Inject the parameter value into the TMSL script manually, or dynamically using external scripts like PowerShell.
- In TMSL, reference the parameter in the partition's query section (e.g., filtering by the key column).
TMSL doesn’t support direct variable substitution, so you need to inject the parameter value via external scripting during execution.
Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂
Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS