using minus sign when creating a calculated column in power bi with a column and measure

Viewed 34

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 -30 1
-B -20 0
-C 10 1
-A 30 0
-B 50 1
-C -2 0

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 -30 1
-B -20 0
-C 10 0
-A 30 0
-B 50 0
-C -2 0

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

This does not work: col_name = IF(table1[Revenue]<=(-[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.

1 Answers

Have you tried this forumla

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

Related