Forum Discussion
smpa01
2 years agoCommunity Champion
Retrieving viz DAX
dm-p d_gosbell GilbertQ AlexisOlson @gbrueckl
I am querying a view (table viz) from a power bi semantic model published in a workspace with premium capacity. The model is developed by a separate te...
AlexisOlson
2 years agoSuper User
I believe this is probably possible. I'm not sure exactly how, but I know Measure Killer uses APIs to read report definitions in the Power BI Service, which include visual definitions.
For the visual above, the JSON definition when stored in the PBIP format looks like this under the new PBIR format.
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.0.0/schema.json",
"name": "70256f0a34f1cbdabdaa",
"position": {
"x": 572.21995926680245,
"y": 194.86761710794298,
"z": 0,
"width": 458.16700610997964,
"height": 206.59877800407332,
"tabOrder": 0
},
"visual": {
"visualType": "tableEx",
"query": {
"queryState": {
"Values": {
"projections": [
{
"field": {
"Column": {
"Expression": {
"SourceRef": {
"Entity": "Table1"
}
},
"Property": "Column1"
}
},
"queryRef": "Table1.Column1",
"nativeQueryRef": "Column1"
},
{
"field": {
"Aggregation": {
"Expression": {
"Column": {
"Expression": {
"SourceRef": {
"Entity": "Table1"
}
},
"Property": "Column1"
}
},
"Function": 3
}
},
"queryRef": "Min(Table1.Column1)",
"nativeQueryRef": "First Column1"
},
{
"field": {
"Aggregation": {
"Expression": {
"Column": {
"Expression": {
"SourceRef": {
"Entity": "Table1"
}
},
"Property": "Column1"
}
},
"Function": 2
}
},
"queryRef": "Count(Table1.Column1)",
"nativeQueryRef": "Count of Column1"
},
{
"field": {
"Measure": {
"Expression": {
"SourceRef": {
"Entity": "Table1"
}
},
"Property": "Measure1"
}
},
"queryRef": "Table1.Measure1",
"nativeQueryRef": "Measure1"
}
]
}
}
},
"drillFilterOtherVisuals": true
}
}
You can read the column definitions from this format, at least in principle.
smpa01
2 years agoCommunity Champion