Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Nishantjain
Continued Contributor
Continued Contributor

Custom Visual - Conditional formatting title

I have built a custom visuals that becomes unresponsive as soon as I add a custom expression in the "Title". If the title is hard coded e.g. if I write "abc" in the title, it works fine. However, if I use the new feature, conditional-format-visual-titles it stops working.   

 

Duing some digging I found the following which I can't get my head around:

 

If I define my data roles as 

 

"dataRoles": [
{
"displayName": "Values",
"name": "values",
"kind": "Measure"
}
]
and use this with "Expresssion based Title", the visual doesn't work.
 
if I change the data role as below, it works as expected.
 
"dataRoles": [
{
"displayName": "Values",
"name": "measure",
"kind": "Measure"
}
]
If I use any "name" other than "measure", along with "Expression based Title", it completely stops working. 

Not sure where to even start looking

Thanks
1 ACCEPTED SOLUTION
dm-p
Super User
Super User

Hi @Nishantjain,

I've just tested this real quick in a test visual I had created recently and it seems to work fine.

I think that your issue might be unrelated to the condtional title, and is more to do with the dataRole but without more code, it's hard to confirm.

If you rename the dataRole, you'll also need to update any code you've written to process the dataView to use the revised name too, otherwise your code will crash out and the visual will stop rendering, unless you add some error handling around it.

Are you able to share the part of your code that processes the dataView? We can probably solve it pretty quickly if so.

Thanks,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




View solution in original post

3 REPLIES 3
dm-p
Super User
Super User

Hi @Nishantjain,

I've just tested this real quick in a test visual I had created recently and it seems to work fine.

I think that your issue might be unrelated to the condtional title, and is more to do with the dataRole but without more code, it's hard to confirm.

If you rename the dataRole, you'll also need to update any code you've written to process the dataView to use the revised name too, otherwise your code will crash out and the visual will stop rendering, unless you add some error handling around it.

Are you able to share the part of your code that processes the dataView? We can probably solve it pretty quickly if so.

Thanks,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Nishantjain
Continued Contributor
Continued Contributor

@dm-p 

 

Thanks Daniel for your reply. I was able to figure out the issue was with my "DataView" mapping. The didn't had all my fields mapped in DataView. The visual is now working as expected. 


However, the frustrating thing is that the unexpected behaviour was quite difficult to debug. I can't understand why it will be a problem only for "expression based" title.

 

I guess this isn't an issue that a lot of peoeple have faced. 

 

Thanks again for your help


Nishant

Glad you're rocking 🙂

JS/TS can typically be tricky to debug, particularly if it's all running client-side and I've gotten into the habit of writing to the console throughout the lifecycle of my visual so that I can understand exactly where things go wrong, if they do. I disable this for release versions of my visuals, but it's invaluable when developing.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.