Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Numbers and text in X-axis line/area chart

Hi team,

I have an area chart where  X-axis is year/month field, y-axis is a value.

DateValue
2023-08-01null
2023-09-0148%

 

Is there a way, if I have an empty (null) value for one month to show the month and text on the axis as "No campaign", and all other months to show values. 


I tried but the visual doesn't accept text and number field in one. Another option,if it's possible if we have null to replace it with 0% but I need some kind of a tooltip/indicator where I can see the text "No campaign". (because it's possible for some months to have 0 and for other null).

Thank you.

  • Hi Anonymous 
    You can use customized labels for these results :

    Create a measure like :

    label = IF([value_]>0,FORMAT([value_],"0%"),"no campaigns" )
    and put it on the graph:

    PBIX is attached

    More information about customized labels is here:

    https://www.youtube.com/watch?v=MHaIDMu73sw

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

     

  • Hi Anonymous 
    Yes of course it is working from service...
    The image after publishing :

     

    Try to publish the report again, and Refresh the web page with F5 after publishing

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

3 Replies

  • Hi Anonymous 
    You can use customized labels for these results :

    Create a measure like :

    label = IF([value_]>0,FORMAT([value_],"0%"),"no campaigns" )
    and put it on the graph:

    PBIX is attached

    More information about customized labels is here:

    https://www.youtube.com/watch?v=MHaIDMu73sw

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Ritaf1983 ,

      Thank you very much for the solution- it works!

      Quick question -I updated my report in PBI desktop, but in PBI Service (after upload), the text "no campaings" doesn't show.  Is this work with you in the service or have you ever tested this custom label  in pbi service?

      Thank you.

      • Ritaf1983's avatar
        Ritaf1983
        Icon for Super User rankSuper User

        Hi Anonymous 
        Yes of course it is working from service...
        The image after publishing :

         

        Try to publish the report again, and Refresh the web page with F5 after publishing

        If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly