cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SabineOussi Established Member
Established Member

Dynamic Text

Hello,

 

Is there a way that I can create a dynamic text within the text box?

 

In other words, let's say I want to display the following:

There are @numberoftickers submitted by @numberofusers and managed by @numberofadmins 

@numbers will be a count of certain fields.

 

I know that I can create a card of the desired count and a text box with a specified space and put them on top of each other so that they appear as they're written in one sentence.

 

But is therer a better way to do it? Like sort of a hyperlink to columns?

 

Thanks,

Sabine O.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
SqlJason Member
Member

Re: Dynamic Text

What you can do is to create a measure like 

TextMeasure = "There are " +  [numberoftickers] + " submitted by " + [numberofusers] + " and managed by " + [numberofadmins]

 

Now you can place this measure in a text box and that should show the desired result. Using text based measures is a handy technique in scenarios like this. 

View solution in original post

12 REPLIES 12
HarrisMalik Established Member
Established Member

Re: Dynamic Text

@SabineOussi as far as I know text expressions are not yet available but as you mentioned you can do some workarounds.

Highlighted
SqlJason Member
Member

Re: Dynamic Text

What you can do is to create a measure like 

TextMeasure = "There are " +  [numberoftickers] + " submitted by " + [numberofusers] + " and managed by " + [numberofadmins]

 

Now you can place this measure in a text box and that should show the desired result. Using text based measures is a handy technique in scenarios like this. 

View solution in original post

greggyb New Contributor
New Contributor

Re: Dynamic Text

@SqlJason, & is the concatenation operator in DAX; + is not overloaded as in SQL.

 

As an additional point, depending on the measure being used to provide the numeric portion of this string, you may find a need for FORMAT(), which allows you to use a format string to alter the display of a numeric or date value.

SqlJason Member
Member

Re: Dynamic Text

My bad, I forgot to test it before posting :).... Yes you will have to use the & operator as well as FORMAT() based on your needs as @greggyb mentioned.

SabineOussi Established Member
Established Member

Re: Dynamic Text

Yes, I'm aware about the language, thanks.

 

I was just hoping to have a more direct solution.

MrDataGeek Frequent Visitor
Frequent Visitor

Re: Dynamic Text

@SqlJason how do you set a textbox to the value of a measure? I was able to create a measure that returns a dynamic title using your method but I don't know how to set a textbox a measure. I was able to do so using the "card" visualization but I don't want to use that visualization because it uses the name of the measure as a default title. 

SabineOussi Established Member
Established Member

Re: Dynamic Text

@MrDataGeek it is a card visualization and not a textbox. You can turn off the category label, turn on the title and put the title text you want.

MrDataGeek Frequent Visitor
Frequent Visitor

Re: Dynamic Text

Thanks @SabineOussi! I figured that out last night and I was about to update my question before I saw your response. I did not initially think to turn off the "category label". I appreciate your help!

ChrisHaas Established Member
Established Member

Re: Dynamic Text

Chris Webb has blogged about a fantastic solution that listens to slicer values to dynamically create a title.  Very similar solution using a card with no category that "sits on top of" of chart, but a little more robust.

 

Helpful resources

Announcements
New Ranks and Rank Icons in 2020

New Ranks and Rank Icons in 2020

Read the announcement for more information!

New Kudos Given Badges Coming

New Kudos Given Badges Coming

We're rolling out new Kudos Given badges. Find out how many Kudos you've given.

November 2019 Community Highlights

November 2019 Community Highlights

Get an overview of the events and great community content from November.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)