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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
delithyotho
Frequent Visitor

How to place a comma from an existing card formatted to text

Thanks to @amitchandak for fixing my measure below, it works perfectly. nNow, the next task is I would like to have a comma separator whenver it says for example $1000.0M, and convert it to $1,000.0M. 

 

Here's the measure:

Card graph =
Var Total1 = CALCULATE(SUM('MasterData'[Sum1])*1000000)
Var Total2 = CALCULATE(SUM('MasterData'[Sum2])*1000000)
Var decimal = "0.0"
RETURN
SWITCH ( TRUE() ,
Total2 >= 1000000000 , CONCATENATE("$", FORMAT (Total1/1000000000, decimal & "bn")) ,
Total2 < 1000000000, CONCATENATE("$", FORMAT (COALESCE(Total1, 0)/1000000, decimal & "M")) ,
CONCATENATE("$", FORMAT (COALESCE(Total1, 0) , decimal)
))
 
This measure will convert it to text so I'm unable to use the Callout Value functions in the Card Graph.
 
Thanks in advance!
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@delithyotho , try like

 

Card graph =
Var Total1 = CALCULATE(SUM('MasterData'[Sum1])*1000000)
Var Total2 = CALCULATE(SUM('MasterData'[Sum2])*1000000)
Var decimal = "0.0"
RETURN
SWITCH ( TRUE() ,
Total2 >= 1000000000 , CONCATENATE("$", FORMAT (Total1/1000000000, "#,###.0") & "bn") ,
Total2 < 1000000000, CONCATENATE("$", FORMAT (COALESCE(Total1, 0)/1000000, "#,###.0" )& "M") ,
CONCATENATE("$", FORMAT (COALESCE(Total1, 0) , "#,###.0")
))

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@delithyotho , try like

 

Card graph =
Var Total1 = CALCULATE(SUM('MasterData'[Sum1])*1000000)
Var Total2 = CALCULATE(SUM('MasterData'[Sum2])*1000000)
Var decimal = "0.0"
RETURN
SWITCH ( TRUE() ,
Total2 >= 1000000000 , CONCATENATE("$", FORMAT (Total1/1000000000, "#,###.0") & "bn") ,
Total2 < 1000000000, CONCATENATE("$", FORMAT (COALESCE(Total1, 0)/1000000, "#,###.0" )& "M") ,
CONCATENATE("$", FORMAT (COALESCE(Total1, 0) , "#,###.0")
))

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

Top Solution Authors