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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
rdvasisht
Frequent Visitor

using minus sign with a measure when creating a calculated column using if stmt

I need to create a column in Power BI using following criteria. Any assistance is appreciated.

What I need: I need to compare a column with a measure and get 1 or 0. The measure must be in negative.

I tried to add minus sign in front of measure but it does not give me the value that should be in the new col that I am creating. I also tried to create the measure by multiplying it with -1 to get negative measure. I get the negative measure, but when I use that measure to create the col it does not yield me the right values.

Can you please tell me how I can add a "-" minus sign and have the right value in the created column.

for e.g.

Task Revenue NEW_COL
-A-301
-B-200
-C101
-A300
-B501
-C-20

A measure value that I have = a_measure = 27.58

Above table is what I get when I apply -- This does not work: col_name = IF(table1[Revenue]<=(-[a_measure]),"1","0")

 

Task Revenue NEW_COL
-A-301
-B-200
-C100
-A300
-B500
-C-20

Above is the col I get when I apply following -- This works: col_name = IF(table1[Revenue]<=(-27.58),"1","0")

 

These do not work: col_name = IF(table1[Revenue]<=-([a_measure]),"1","0")

col_name = IF(table1[Revenue]<=(-[a_measure]),"1","0")

col_name = IF(table1[Revenue]<=(-1*([a_measure])),"1","0")

 

I need to use the measure in the formula as the value in the measure is subject to change. the 2nd table is what i need by using the -ve measure.

 

any comment or suggestion is appreciated. 

1 REPLY 1
MFelix
Super User
Super User

Hi @rdvasisht 

 

You cannot use metrics in a column in a dynamic way, since when you use measure this is based on context, and using it in a column.

 

In this case you need to create a measure for the column value, what is the purpose of this calculated column?


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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