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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.