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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
Super User
Super User

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors