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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

The format of the measure

Hi all.

 

How  can bring the following outcome of my measure?measure.JPG

Basically it is var1 / var2 (var3). But not sure how to wrap it in brackets and separate with the slash.

1 ACCEPTED 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) &")"

 

View solution in original post

8 REPLIES 8
themistoklis
Community Champion
Community Champion

@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) &")"

 

Anonymous
Not applicable

@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) &")"

 

Anonymous
Not applicable

 

@themistoklis 

 

Nevermind, figured out the formatting part myself 🙂 thanks for help!

 

VAR Percentage = FORMAT(IF (
Yes_Count > 0,
DIVIDE ( Yes_Count, People_Count ), 0), "0%")
Anonymous
Not applicable

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 ?

VAR Percentage = IF (
Yes_Count > 0,
DIVIDE ( Yes_Count, People_Count ), 0)

@Anonymous 

 

Select the Measure from fields section.

 

Then on Menu on top --> Column Tools -->Format section (put 0)

amitchandak
Super User
Super User

@Anonymous 

 

assuming they are part of the return

var1 & " / " & var2  & "(" & var3 & ")"

 

order replace var1,2 and 3 with measures

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks, @amitchandak 

 

But getting an error:  "can not convert value '/' of type Text to type true/false"

 

My measure:

Chat 2 =
VAR People_Count =
CALCULATE (
DISTINCTCOUNT ( 'Teams statistics'[User Principal Name] ) - 1,
'user AD'[IsManager] = 1
|| 'user AD'[IsManager] = 0)
VAR min_level =
MIN ( 'user AD'[User Org Level] )
VAR Yes_Count =
CALCULATE (
DISTINCTCOUNT ( 'Teams statistics'[User Principal Name] ),
'Teams statistics'[Chat] = "Yes",
'user AD'[IsManager] = 1
|| 'user AD'[IsManager] = 0,
'user AD'[User Org Level] <> min_level)
VAR No_Count =
CALCULATE (
DISTINCTCOUNT ( 'Teams statistics'[User Principal Name] ),
'Teams statistics'[Chat] = "No",
'user AD'[IsManager] = 1
|| 'user AD'[IsManager] = 0,
'user AD'[User Org Level] <> min_level
)
VAR Percentage = IF (
Yes_Count > 0,
DIVIDE ( Yes_Count, People_Count ), 0)
RETURN
CONVERT(Yes_Count, STRING) && "/" && CONVERT(People_Count, STRING) && "("&& CONVERT(Percentage, STRING) &&")"

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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