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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
MarkusEng1998
Resolver II
Resolver II

Power BI Web removes intended, extra spaces in Measure

I created a measure that simulates two columns with a percentage and (count). It works fine in the Desktop. But the web version removes the spaces. The obvious solution is to simply use two columns, but the request is to combine both values into one column...

 

Is there another UNICHAR I should use that won't get trimmed?

Please advise. Thank you!

 

 

 

_rm% = 

VAR vRmPercent = CONVERT(ROUND(AVERAGE('200AttrRmCount'[rmPercent]), 2)*100, STRING)
VAR vLen	= LEN(vRmPercent)
VAR vLenRm  = LEN(CONVERT('200AttrRmCount'[_rmCount], STRING))
VAR vSpace  = 8
RETURN

IF (vLen = 0, "n/a", 
	IF (vLen = 1, "0" & vRmPercent & "%", vRmPercent & "%" )
		& REPT(UNICHAR(127), vSpace-vLenRm) & "(" & [_rmCount] & ")")

 

 

PowerBI 2023-10-17_10-40-44.jpg

2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @MarkusEng1998 
Try to calculate 2 measures separately and just concatenate them in the basic way with space :
Final_measure = [measure1]&" "&[measure2]

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

@MarkusEng1998 
Good luck, 99.99% it will work 🙂

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

8 REPLIES 8
MarkusEng1998
Resolver II
Resolver II

Sorry, it did not work.

 

 

Can you share 2-3 in your pbix , i will check it on my machine ?

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

combined measure 2 & 3

_rem%Total = VAR vRmPercent = CONVERT(ROUND(AVERAGE('200AttrRmCount'[rmPercent]), 2)*100, STRING)
VAR vLenRm  = LEN(CONVERT('200AttrRmCount'[_rmCount], STRING))
VAR vSpace  = 8
RETURN

[_rm%2] &
 REPT(UNICHAR(127), vSpace-vLenRm) &
[_rm%3]

 

MarkusEng1998_0-1697654953989.png

 

measure 3

_rm%3 = 

VAR vRmPercent = CONVERT(ROUND(AVERAGE('200AttrRmCount'[rmPercent]), 2)*100, STRING)
VAR vLen	= LEN(vRmPercent)
VAR vLenRm  = LEN(CONVERT('200AttrRmCount'[_rmCount], STRING))
VAR vSpace  = 8
RETURN

"(" &
IF (vLenRm > 3, 
		LEFT([_rmCount], vLenRm-3) & "," & RIGHT([_rmCount], 3),
		[_rmCount])
		& ")"

measure 2

_rm%2 = 

VAR vRmPercent = CONVERT(ROUND(AVERAGE('200AttrRmCount'[rmPercent]), 2)*100, STRING)
VAR vLen	= LEN(vRmPercent)
VAR vLenRm  = LEN(CONVERT('200AttrRmCount'[_rmCount], STRING))
VAR vSpace  = 8
RETURN

IF (vLen = 0, "n/a", 
	IF (vLen = 1, "0" & vRmPercent & "%", vRmPercent & "%" ))
MarkusEng1998
Resolver II
Resolver II

Thank you @Ritaf1983 , I will give this a try!

@MarkusEng1998 
Good luck, 99.99% it will work 🙂

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Ritaf1983
Super User
Super User

Hi @MarkusEng1998 
Try to calculate 2 measures separately and just concatenate them in the basic way with space :
Final_measure = [measure1]&" "&[measure2]

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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