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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
ClaudioL
Helper IV
Helper IV

+ And - sign on cards

Good day,
I am using the type of card "Card with States by OKVIZ" for some dashboards that I create in power bi desktop. In the case of positive values I am showing them in a green color, and in the case of negative values in red. The problem I have is that the company management wants the "+" sign to appear in front of the value in positive values (with green color), since the card appears by default in negative values.
Is there a way to add this "+" sign?
From already thank you very much.

Regards.

2 ACCEPTED SOLUTIONS
OwenAuger
Super User
Super User

Hi @ClaudioL 

 

You can do this by providing a custom number format for the measure/column that you are displaying on the visual.

 

Go to the Model tab, select the colum/measure, and under Formatting choose Format = Custom and enter a format like 

+0;-0;0

(Microsoft documentation page)

 

I tested this with the Card with States visual and it works fine.

 

Regards

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

Tahreem24
Super User
Super User

@ClaudioL ,

Try the below COde:

Measure = IF(SUM(Table[Values])>0,"+","-")
Then use this measure next to your cards. (Adjust it nicely)
And if you want to do color so use the color formattig on above measure.
1.PNG2.PNG

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

8 REPLIES 8
Tahreem24
Super User
Super User

@ClaudioL ,

Try the below COde:

Measure = IF(SUM(Table[Values])>0,"+","-")
Then use this measure next to your cards. (Adjust it nicely)
And if you want to do color so use the color formattig on above measure.
1.PNG2.PNG

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
OwenAuger
Super User
Super User

Hi @ClaudioL 

 

You can do this by providing a custom number format for the measure/column that you are displaying on the visual.

 

Go to the Model tab, select the colum/measure, and under Formatting choose Format = Custom and enter a format like 

+0;-0;0

(Microsoft documentation page)

 

I tested this with the Card with States visual and it works fine.

 

Regards

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Custom format option is not available for on-premises, so this solution is not correct.

@DmitryKo Interesting. What do you mean by "on-premises" in this case and specifically when have you observed that this doesn't work?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

By "on premises" I mean Power BI Report server. Observed it just now. Power BI Desktop's version for the report server does not provide option for "custom" format for the measure

Interesting...I tried installing the latest version of Power BI Desktop (Report Server version) and was able to change measure format strings, in Measure tools on the ribbon and Model View.

 

Which version of Power BI Desktop RS are you using, and just confirming you're working in a PBIX containing the dataset?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Please fix your signature, it's terrifying. 2/3 of the post space is taken by signature making it completely unreadable

DmitryKo_0-1663162197258.png

 

Version is 2.105.1143.0 (May 2022) which seems to be the latest. Yes, PBIX contains the dataset, it's not offloaded to some tabular storage.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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