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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. 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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.