Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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.
| -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")
| -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")
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.
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
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsAdvance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.