The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi all.
How can bring the following outcome of my measure?
Basically it is var1 / var2 (var3). But not sure how to wrap it in brackets and separate with the slash.
Solved! Go to Solution.
@Anonymous
remove double ampersand (&&) and put just one (&)
Replace this
CONVERT(Yes_Count, STRING) && "/" && CONVERT(People_Count, STRING) && "("&& CONVERT(Percentage, STRING) &&")"
With this
CONVERT(Yes_Count, STRING) & "/" && CONVERT(People_Count, STRING) & "("&& CONVERT(Percentage, STRING) &")"
@Anonymous
Make sure you convert numbers to string. You can either do it in the variable or directly. See example below
var1 = CONVERT(Table[Amount],STRING)
var2 = CONVERT(Table[Amount2],STRING)
var3 = CONVERT(Table[Percent],STRING)
RETURN
var1 & " / " & var2 & " (" & var3 &")"
Or do it directly in a column. See below:
Column = CONVERT(Table[Amount],STRING) & " / " & CONVERT(Table[Amount2],STRING) & " (" & CONVERT(Table[Percent],STRING) &")"
@themistoklis , thanks
But getting an error: "can not convert value '/' of type Text to type true/false"
my measure is in previous comment.
@Anonymous
remove double ampersand (&&) and put just one (&)
Replace this
CONVERT(Yes_Count, STRING) && "/" && CONVERT(People_Count, STRING) && "("&& CONVERT(Percentage, STRING) &&")"
With this
CONVERT(Yes_Count, STRING) & "/" && CONVERT(People_Count, STRING) & "("&& CONVERT(Percentage, STRING) &")"
Nevermind, figured out the formatting part myself 🙂 thanks for help!
wow, @themistoklis , thank you! Will have to change my habbits 🙂
Would you also happen to know how to format the following variable so it would bring percentage with no decimal places ?
@Anonymous
Select the Measure from fields section.
Then on Menu on top --> Column Tools -->Format section (put 0)
Thanks, @amitchandak
But getting an error: "can not convert value '/' of type Text to type true/false"
My measure:
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
20 | |
12 | |
10 | |
7 |