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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Doug7983
Helper I
Helper I

Deneb | Vega-Lite tooltip issue

With much help from @giammariam , I have a Deneb custom visual that is exactly what I want--except for the tooltip. Deneb is displaying the tooltip for the highlighted null data point as 0.0%. I would expect to see a blank. 

 

data.png

Here is the relevant part of the tooltip block from my spec:

{
"field": "Growth (month over year-ago month)",
"type": "quantitative",
"format": ".1%"
},

 

This works great except for the display of the last data point, which again should be blank, null, "n/a" or something of the sort.

 

Appreciate any help. 

 

 

1 ACCEPTED SOLUTION

Thanks @Doug7983, try the following:

 

  1. In the top transform array add the following: 

 

    ,
    {
      "calculate": "isValid(datum['Growth (MoYaM)']) ? format(datum['Growth (MoYaM)'], '.1%') : ''",
      "as": "Growth (MoYaM) Tooltip"
    },
    {
      "calculate": "isValid(datum['Growth (WDC)']) ? format(datum['Growth (WDC)'], '.1%') : ''",
      "as": "Growth (WDC) Tooltip"
    }

 

Note - if you want it to show null or n/a, replace the '' with null or 'n/a'. As it is currently, it will just be blank

 

2. Update the tooltip to the following:

 

      "tooltip": [
        {"field": "Category", "type": "nominal"},
        {"field": "Date", "type": "temporal"},
        {"field": "Growth (MoYaM) Tooltip", "title": "Growth (MoYaM)", "type": "nominal"},
        {"field": "Growth (WDC) Tooltip", "title": "Growth (WDC)", "type": "nominal"}
      ],

 

giammariam_1-1698953684859.png

 

 

Let me know if this works



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

Do you frequently use Deneb to provide insights to your stakeholders? Have you considered sponsoring this free and open source custom visual? More info here!

View solution in original post

5 REPLIES 5
giammariam
Super User
Super User

Ha, thanks @Doug7983. Feel free to reach out anytime. 



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

Do you frequently use Deneb to provide insights to your stakeholders? Have you considered sponsoring this free and open source custom visual? More info here!
Doug7983
Helper I
Helper I

Hey @giammariam, thanks for the response. Security policies prevent me from sharing a pbix in that manner. Here's the thread where you helped me with the spec.

 

Thank you.

Thanks @Doug7983, try the following:

 

  1. In the top transform array add the following: 

 

    ,
    {
      "calculate": "isValid(datum['Growth (MoYaM)']) ? format(datum['Growth (MoYaM)'], '.1%') : ''",
      "as": "Growth (MoYaM) Tooltip"
    },
    {
      "calculate": "isValid(datum['Growth (WDC)']) ? format(datum['Growth (WDC)'], '.1%') : ''",
      "as": "Growth (WDC) Tooltip"
    }

 

Note - if you want it to show null or n/a, replace the '' with null or 'n/a'. As it is currently, it will just be blank

 

2. Update the tooltip to the following:

 

      "tooltip": [
        {"field": "Category", "type": "nominal"},
        {"field": "Date", "type": "temporal"},
        {"field": "Growth (MoYaM) Tooltip", "title": "Growth (MoYaM)", "type": "nominal"},
        {"field": "Growth (WDC) Tooltip", "title": "Growth (WDC)", "type": "nominal"}
      ],

 

giammariam_1-1698953684859.png

 

 

Let me know if this works



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

Do you frequently use Deneb to provide insights to your stakeholders? Have you considered sponsoring this free and open source custom visual? More info here!

You're incredible, @giammariam . Thanks so much. 

giammariam
Super User
Super User

Hey @Doug7983, thanks for the tag. Can you either send me your .pbix  (here's how), or send me the link to the post where I helped you originally? Happy to dive back into the spec and get this straight for you, I would just would need to refamiliarize myself with what I did.



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

Do you frequently use Deneb to provide insights to your stakeholders? Have you considered sponsoring this free and open source custom visual? More info here!

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors