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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
AutyDA
Helper I
Helper I

Unwanted spaces appear in dynamic text in text box

I've created a dashboard with various charts which I am adding explanatory text boxes to where I am using dynamic values based upon measures I have established. The measures are for values and text. Whilst everything works additional spaces are being added after the dynamic text items which I need to remove.

 

For example in the text box below the statement "The oil price outperformed the company share price growing whilst the company share price fell during the period" has a return added after it which creates a large space before the "from" whilst the dynamic dates are input ("01/01/2014" and "12/31/2023") without any additional returns or spaces been added.

 

Why is this occurring and is there a fix?

 

AutyDA_0-1726646742068.png

 

3 REPLIES 3
AutyDA
Helper I
Helper I

I am using a text box to visualize it and rather than using one measure, as per your example, my text box refers to multiple measures as these are all dynamic and vary independently. So in my example I am adding the value of 3 measures to my text box:

 

Measure 1 - 

IndexText =
 IF (AND((SELECTEDCOMPANY[Share Price_MovementText] = "increased"),(SELECTEDCOMPANY[WTI_MovementText] = "increased")), "Both WTI and company share prices performed positively during the period",
 IF (AND((SELECTEDCOMPANY[Share Price_MovementText] = "decreased"),(SELECTEDCOMPANY[WTI_MovementText] = "decreased")), "Both WTI and company share prices performed negatively during the period",
 IF (AND((SELECTEDCOMPANY[Share Price_MovementText] = "increased"),(SELECTEDCOMPANY[WTI_MovementText] = "decreased")), "The company share price outperformed oil price growing whilst oil price fell during the period", "The oil price outperformed the company share price growing whilst the company share price fell during the period")))
 
Measure 2 - 
StartDate = CALCULATE (min('DateTable'[Date]))
 
Measure 3 - 
EndDate = CALCULATE (max('DateTable'[Date]))
 
My dynamic text box is then composed of (1) standard text (2) IndexText (Measure 1), (3) standard text "from" (4) 
StartDate (Measure 2) (5) standard text "to" (6) EndDate (Measure 3).
 
I hope this makes sense.
 

Whilst I've not solved the problem I did find a workaround based upon Selva-Salimis answer. It's not pretty but creating a new measure which concatenates the other measures provides one continous text. This measure then can de added as the dynamic text to the text box.

 

I'd still love to know why the space appears in the original situation as a quick fix on this should be possible. 

Selva-Salimi
Solution Specialist
Solution Specialist

Hi @AutyDA 

 

How did you write your measure?? and which visual did you use to visualize? I had used a card and use a measure as follows and there is not any problem.

text = var min_date= min('DimDate (2)'[Dates])
var max_date = max('DimDate (2)'[Dates])
return
CONCATENATE(CONCATENATE(CONCATENATE("The oil price outperformed the company share price growing whilst the company share price fell during the period from" , min_date), "to"), max_date)
 
If this post helps, then I would appreciate a thumbs up  and mark it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.