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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
LFM
Helper III
Helper III

Minus sign in front of value where there is a certain text

Hello. I want to make a minus sign in front of a value in a column that corresponds to a text value in another column. Shown under I want make a "-" sign in front of all the numbers in lots when buy or sell is sell?

LFM_0-1721400637958.png

Like this:

Buy2
Sell-1
Sell-3
Buy2
Sell-1
1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi @LFM ,

 

There are multiple ways to achieve your required output, and one of them is to write a calculate column like below:

 

Sign = if('Table'[Text]="Sell",'Table'[Lots]*-1,'Table'[Lots])

 

 

DataNinja777_0-1721402256669.png

I attach an example pbix file.  

Best regards,

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

Minus sign in front of a value that corresponds to... - Microsoft Fabric Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Kaviraj11
Super User
Super User

Hi,

 

You can create a calculated column as below:

 

ColumnName=

SWITCH(TRUE(),TableName[Buy or Sell]="Sell",-ABS(TableName[Lots]),ABS(TableName[Lots]))
 
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
 
 



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





DataNinja777
Super User
Super User

Hi @LFM ,

 

There are multiple ways to achieve your required output, and one of them is to write a calculate column like below:

 

Sign = if('Table'[Text]="Sell",'Table'[Lots]*-1,'Table'[Lots])

 

 

DataNinja777_0-1721402256669.png

I attach an example pbix file.  

Best regards,

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors