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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Aakash15
New Member

need help with resolving double '-' symbol from dymanic datalable using tabular editor

Hello
I am in need to present a bar chart with dynamic data lables (data lables drived by dax). to acheive that I have use external tool called tabular editor. with this i written format string expression.
The requirement is i need to concadiante '-' for negative values and '+' for positive values and also % for some attributes.

 

below i present the dax in tabular editor Ver.2
expression.jpg

 

Here i used format string expression to customise the data lable

format string expression.jpg

 

this is output. we can clearly see double '-' symbol at the first value but for others all is fine.

output.jpg

 

I need help regarding this

3 REPLIES 3
timtack
Frequent Visitor

I found your topic @Aakash15 while searching for an answer for my dynamic format problem, because i got two -- for negative values. I found an answer for my dynamic formatting with some behaviour testing. 
E.g. i wanted following format, but for negative Values i got "-- XXX K":

"""" & FORMAT(SELECTEDMEASURE(), "#,0, K")

Then i tested where this second - came from. I recognized, that PowerBI adds an "-" infront of my Format(...). With following code, the result was "-  -XXX K"

"  " & FORMAT(SELECTEDMEASURE(), "#,0, K")

So i wanted to get rid of one minus. I achieved that with formatting negativ values like positive ones, because it adds an "-" before Format(). This works for me:

 """" & FORMAT(SELECTEDMEASURE(), "#,0, K;#,0, K")

 

Eventhough the answer is pretty late, i hope this helps you or someone else!

amitchandak
Super User
Super User

@Aakash15 , In the format function you have options for positive and negative values

https://learn.microsoft.com/en-us/dax/format-function-dax#custom-numeric-formats

 

Just use \+ on positive value at start

 

example 

\+#,###.00

or try

+#,###.00

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hello Amit,
Really thanks for Reply. but unfortunatly it doesn't solve the issue. i went with bit of hardcoaded way, right now its fine but with no surity, I ll be glad if you can help with any other solution to it.
Thankyou.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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