If you rename the .pbix file to .zip and open it as a zip file you will see a Report folder and then a file called Layout
. If you copy that file out of the .zip file and open it in a text editor (preferably an app which can format JSON) you will see the following:
{
"id": 0,
"resourcePackages": [
//some packages here
],
"sections": [
//some sections here...
],
"config": "{\"version\":\"5.3\",\"themeCollection\":{\"baseTheme\":{\"name\":\"CY19SU06\",\"version\":\"5.5\",\"type\":2}},\"activeSectionIndex\":0,\"modelExtensions\":[{\"name\":\"extension\",\"entities\":[{\"name\":\"DimDate\",\"extends\":\"DimDate\",\"measures\":[{\"name\":\"My Report Measure\",\"dataType\":3,\"expression\":\"DIVIDE(99,100)\",\"errorMessage\":null,\"hidden\":false,\"formulaOverride\":null,\"formatInformation\":{\"formatString\":\"G\",\"format\":\"General\",\"thousandSeparator\":false,\"currencyFormat\":null,\"dateTimeCustomFormat\":null}}]},{\"name\":\"DimCustomer\",\"extends\":\"DimCustomer\",\"measures\":[{\"name\":\"My Report Measure 2\",\"dataType\":3,\"expression\":\"99 + 100\",\"errorMessage\":null,\"hidden\":false,\"formulaOverride\":null,\"formatInformation\":{\"formatString\":\"G\",\"format\":\"General\",\"thousandSeparator\":false,\"currencyFormat\":null,\"dateTimeCustomFormat\":null}}]}]}],\"defaultDrillFilterOtherVisuals\":true,\"settings\":{\"useStylableVisualContainerHeader\":true,\"exportDataMode\":1,\"useNewFilterPaneExperience\":true,\"allowChangeFilterTypes\":true},\"objects\":{\"section\":[{\"properties\":{\"verticalAlignment\":{\"expr\":{\"Literal\":{\"Value\":\"'Top'\"}}}}}]}}",
"layoutOptimization": 0
}
If you look in the config
property there's a string which has JSON in it. If you pull out the JSON and format it you will get:
{
"version": "5.3",
"themeCollection": {
"baseTheme": {
"name": "CY19SU06",
"version": "5.5",
"type": 2
}
},
"activeSectionIndex": 0,
"modelExtensions": [
{
"name": "extension",
"entities": [
{
"name": "DimDate",
"extends": "DimDate",
"measures": [
{
"name": "My Report Measure",
"dataType": 3,
"expression": "DIVIDE(99,100)",
"errorMessage": null,
"hidden": false,
"formulaOverride": null,
"formatInformation": {
"formatString": "G",
"format": "General",
"thousandSeparator": false,
"currencyFormat": null,
"dateTimeCustomFormat": null
}
}
]
},
{
"name": "DimCustomer",
"extends": "DimCustomer",
"measures": [
{
"name": "My Report Measure 2",
"dataType": 3,
"expression": "99 + 100",
"errorMessage": null,
"hidden": false,
"formulaOverride": null,
"formatInformation": {
"formatString": "G",
"format": "General",
"thousandSeparator": false,
"currencyFormat": null,
"dateTimeCustomFormat": null
}
}
]
}
]
}
],
"defaultDrillFilterOtherVisuals": true,
"settings": {
"useStylableVisualContainerHeader": true,
"exportDataMode": 1,
"useNewFilterPaneExperience": true,
"allowChangeFilterTypes": true
},
"objects": { "section": [ { "properties": { "verticalAlignment": { "expr": { "Literal": { "Value": "'Top'" } } } } } ] }
}
You will see My Report Measure
in the DimDate table which is expression DIVIDE(99,100)
and My Report Measure 2
in the DimCustomer table which is expression 99 + 100
. Those are simplistic examples but that gives you the idea.
Obviously this is all undocumented and subject to change. But that's the only way I'm aware of to get these measures which are added to the PBIX (rather than measure in the SSAS model itself).