Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
2 years ago
Solved

Dynamic Title on Bar Chart

Good afternoon, I hope you are well.

I have the following difficulty.

I want to create a dynamic title in a 100% stacked bar chart, I have just one table like the image below

With this data, he generated the following graph:

As you can see the chart has a title " All products" that's why I don't have any product selected from the table, but when I select a product from the table the same title still appears, it doesn't change to "Product A" if I select A or B if I select "Product B" etc. but it does change when I add a data slicer with the products, I don't want to add a data slicer, I want to filter by the table. The measure I'm using to try to change the title is as follows:

Title Bar 2 =
var _Filtro = SELECTEDVALUE(dimProducts[Products], "All Products")
RETURN
_Filter

I use this measure here:

Please I require your help as to why it doesn't turn out what I want, I get the impression that it must be because of some filter context that I am applying wrong or not applying.

Greetings and thank you in advance.

  • Hello, Thanks for the help.

    In the end the solution was very simple, the table and the graph were not interacting with each other, the default graph had active the (highlight) and not (filter) so when I selected any product from the table the graph moved but did not change the name, I changed the interaction from scrape to filter and what I was looking for worked perfectly.

    I tried the original measurement I included in the question and it turned out, I also tried the measurement you indicated above and it works too.

    Thank you all for the help, problem solved.

    Best regards

8 Replies

  • Daniel29195's avatar
    Daniel29195
    Community Champion

    Syndicate_Admin 



    check 1 : make sure that the table visual is reading product column from the dimension table .

     

    check 2: try this measure

    Title Bar 2 =
    var _Filtro =
    calculate( max(dimProducts[Products] , table_name ) 
    return
    if ( isfiltered(dimProducts[Products]) , _Filtro , "All Products" 
    )
     
     
    hope this works for you . 
     
     
     
     
    If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. Dont forget to hit that  thumbs up button 🫡👍
     
     
     
    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator

      Hello, Thanks for the help.

      In the end the solution was very simple, the table and the graph were not interacting with each other, the default graph had active the (highlight) and not (filter) so when I selected any product from the table the graph moved but did not change the name, I changed the interaction from scrape to filter and what I was looking for worked perfectly.

      I tried the original measurement I included in the question and it turned out, I also tried the measurement you indicated above and it works too.

      Thank you all for the help, problem solved.

      Best regards

  • Daniel29195's avatar
    Daniel29195
    Community Champion

    hello Syndicate_Admin 

    i can give you some fixes, but im pretty sure they wont help .

    so for that, is it possible to share the file so that i can take a look , and get back to you ? 

     

    best regards

  • Syndicate_Admin 

    I noticed a _Filter variable should be _Filtero, please try:

    Title Bar 2 =
    VAR _Filtro =
        SELECTEDVALUE ( dimProducts[Products], "All Products" )
    RETURN
        _Filtro
    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator

      Hello, thanks for your help, but it doesn't work, it still doesn't work.

      Greetings and thank you

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Syndicate_Admin 

    You can try the following measure.

    Measure = IF(ISFILTERED(dimProducts[Products])=FALSE(),"Total los Productos",SELECTEDVALUE(dimProducts[Products]))

    Output

     

    Best Regards!

    Yolo Zhu

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

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Administrator

      Thank you for your support, but I already fixed the problem

      Best regards