Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedJoin us at the 2025 Microsoft Fabric Community Conference. March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for $400 discount. Register now
Summary:
Back in April 2019, the Conditional Formatting feature was introduced for Power BI, allowing the author to select a field or measure to set a dynamic property value, e.g. for Title text. This is achieved through fx buttons. Since that time, this feature has been slowly extended to cover many properties. But not all ...
Editing the json content in PBIP files seems to allow the setting of dynamic expressions in place of static property values - even if the Power BI UI does not provide an fx button. It seems any property can be set dynamically!
Demo Report
PBIP file formats:
The PBIP file format is in preview, and as of March 2025 there are two formats - with and without the PBIR option. You control the format using the Power BI Desktop Options / Preview features settings. The PBIP format is described on this documentation page.
Right now, I prefer the PBIP format without the PBIR option, as shown. My reason is that the PBIR option is not backwards-compatible - you cannot save from PBIR format back to PBIP or PBX format without the PBIR limitations. As well as the PBIR limitations, many important external tools only work on PBIX or PBIP (non-PBIR) formats.
So my first examples in the Details section below show PBIP (non-PBIR) format. Then below that, I show the PBIR format. PBIR format is much cleaner json - much easier to read and much easier to copy and paste nodes. Hopefully the PBIR format is released to General Availability soon.
Detailed steps:
The example shown sets the Y Axis / Title text property using a measure. There is no fx button provided for that property, so the Power BI UI only allows for entering static text values.
First, set another property using the fx button to the desired measure. Here, I set the Chart's Title / Title text to a Measure.
Then, set the target property that you want to set dynamically. I used an easy-to-find value eg ZZZ
Next, open the PBIP files using VS Code or a similar editor, and find the dynamic expression that was set above. Select and copy the expr "node" in the json code.
Then find the target property ZZZ, and select the expr node.
Paste your copied json code and save the file. Open in Power BI Desktop and test.
PBIR format examples:
Select and copy the expr "node" in the json code.
Then find the target property ZZZ, and select the expr node.
Paste your copied json code and save the file. Open in Power BI Desktop and test.
Considerations:
As of March 2025, the PBIP format is in preview, so the file formats might change in the future. Editing the PBIP json files is explicitly not supported. So take care, always take a backup before any edits and test thoroughly afterwards.
I have only tested this for a handful of scenarios. It appears to work all the way through to deployment to the web service (app.powerbi.com), which is the most common deployment scenario.
Origins and credits:
The biggest lightbulb moment for me at the Power BI and Fabric Summit 2025 conference was Jacek Nosal's session on Azure Maps. There, Jacek showed a clever hack of the PBIP format that allowed him to apply a measure to a visual property that does not support that through the Power BI UI - no fx button (in the recording from 31:20). He mentioned copying the expression code in the visual.json file, but didn't dwell on it.
At the time I just went "huh, that's weird". Then I was out walking my dog and it suddenly dawned on me that this could potentially be used anywhere ... OMG!
So I put together a demo of using it on the Column Chart's Y Axis Title, which someone mentioned cannot be set dynamically using the UI.
What do you think? IMO this has the potential to unleash a wave of PBIP hacking ("Jacek-ing"?). I am giving Jacek credit for inspiring this. I did a bit of a search and no-one else seems to have "prior art".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.