Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Good morning,
I am trying to open a Power BI desktop metadata file with Python, specifically the datamodelschema.
When executing:
# Reemplaza 'tu_archivo.txt' con la ruta de tu archivo DataModelSchema
ruta_archivo = 'Cruta del archivo/tu_archivo.txt'
# Cargar el contenido del archivo DataModelSchema
with open(ruta_archivo, 'r') as archivo:
data_model_schema = json.load(archivo)
The script fails and says that has "," unexpected.
Thank you very much, but this is not what I am referring to. When you have the datamodelschema file of Power BI Desktop metadata, it comes in a Python format and does not allow for proper decompression. On one hand, we have seen that it was in a UTF-16 LE format and we have converted it to utf-8 (we are in Spain and it was saved in an American format). The problem we now face is that there are parts that are nested more than twice and it gives us an error. Has anyone been able to read it correctly?
I have the same problem with the Layout file, where we have the label relationship of the visual object with the semantic model field.
Hi @FJESPE3 ,
Perhaps you can refer to Part 4 of the following article on getting Python as an external tool to get metadata for Power BI models.
https://dataveld.com/2020/07/20/python-as-an-external-tool-for-power-bi-desktop-part-1/
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 65 | |
| 46 | |
| 43 | |
| 26 | |
| 19 |
| User | Count |
|---|---|
| 198 | |
| 126 | |
| 102 | |
| 69 | |
| 53 |