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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.