Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Dynamic text box - Measure that returns text doesn't work

Hi,

 

I have an issue while using dynamic content in a text box.

 

If I use the Q&A interface to add a dynamic value based on a measure returning a number, everything works fine.

If I use the Q&A interface to add a dynamic value based on a measure returning a text, nothing is returned (instead of returning the text e.g. "My text" it simply returns nothing).

 

There is no problem with the measure, as it works if I use it in a card visual or in a shape.

 

To add even more to the explanation, when I set my measure to return the value 400, it will return 400 in the text box. As soon as I change to return the text "400" instead of the number 400, then it will yield nothing when used in the text box.

 

Does anyone have already encountered this bug? Is there a solution?

 

Thank you in advance for your answer

Best regards,

Thomas

7 Replies

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi Anonymous 

     

    How about inserting a text box directly without using Q&A? Enter static text into the text box, for the place where should be a dynamic value, click +Value and enter the measure name. Check whether the measure result is correct below "Result". Click Save to add the measure.

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

       

      What you show on your screen is exactly what I do and it is what I call "Q&A" (as it looks your search term in the model and returns an answer).  Measures used in a text box won't return text, even the most simple measure that returns a simple string.

       

      EDIT : reading some other stuff about calculation groups, the following seems totally related to the matter at hand. It seems that adding Calculation Groups to a model makes all text measures seen as "variant".

      https://ideas.powerbi.com/ideas/idea/?ideaid=9d9e204a-db28-4ced-89f9-ea56a1041a06

       



      Best Regards,

      Thomas

      • x_mark_x's avatar
        x_mark_x
        Advocate II

        2025 and the same problem persists...😓

  • dpesante2's avatar
    dpesante2
    Regular Visitor

    Thomas... I am running into the exact issue. Have you been able to find a solution? 

  • dpesante2's avatar
    dpesante2
    Regular Visitor

    Jing, Any updates on this issue? Is there a workaround? Shifting from Textboxes to Cards is not an option for us.

  • I was facing the same issue. I changed the data type of my measure to text & it worked. For ex if you change your measure to 

    var result = divide(a,b,blank())

    return if(isblank(result),"N/A",round(result*100,1) & %)

     

    I wanted to show N/A value if result is blank else show the percentage value.