Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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] & ")")
Sorry, it did not work.
Can you share 2-3 in your pbix , i will check it on my machine ?
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]
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 & "%" ))
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
User | Count |
---|---|
98 | |
91 | |
84 | |
71 | |
67 |
User | Count |
---|---|
114 | |
103 | |
100 | |
72 | |
64 |