Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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êsThis is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
73 | |
58 | |
36 | |
32 |
User | Count |
---|---|
90 | |
62 | |
61 | |
49 | |
45 |