Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi I'm trying to create a DAX column that returns values from a column when the values are greater or equal to 1. The column it's pulling from has values that range from -350 through 250 and I only want to return values >=1.
Solved! Go to Solution.
It looks it has to do with your column name where the operator >= 1 is interfering with the DAX [Days Late by BU >= 1]. Can you try changing it by either removing ">= 1" operator or replacing the spaces with underscores?
e.g. [Days_Late_by_BU_>=_1] or simply
[One or more days late] =
if(
NPW[Days Late HR]>=1,
NPW[Days Late HR],
BLANK()
)
is this what you want?
Measure =
SWITCH(true(),average('Table (2)'[amount])>=1,">=1")
Proud to be a Super User!
hi @ryan_mayu thanks for your suggestion but that isn't what i was looking for. My fault for not providing more details. The response i sent to @Anonymous provides what i'm trying to do and where i'm at with his suggestions. Basically trying to create new column that only return data from a different column based on the specific criteria (>=1). From there, i want to take the average of that column which would be my end goal.
Hi @Antonio195754,
If I understand correctly, you want to check if the value of a cell in a column is greater than or equal to one, and if it is, then you want to return that value. You can create a column that returns a blank if the value is lower than 1 and the actual value of your column (in this example column "numbers") this way:
new_number_col = if(
table[numbers]>=1,
table[numbers],
BLANK()
)
Depending on your use case however, it might make more sense to create a measure that returns what you are looking for. E.g. measures for the average value, or the sum of values, for all values equal to or greater to one:
new_number_col = if(
table[numbers]>=1,
TRUE(),
FALSE()
)
If I misunderstood your question and you instead want to return a value from another column based on whether the value from the numbers columns is equal to or greater than one, then you can swap out TRUE() in the expression above with the column you want to get the value from and change the FALSE() to return the value you would like.
Hope this helps, have a great weekend!
hi @Anonymous and thank you for your suggestions. After reading your feedback I tried the column logic you provided and it worked to a certain extent. What it's doing is only returning a 1 or a 0 when it meets the criteria. it will return a 1 if it's greater or = 1, and a 0 if the number from the column is less than or =1. In theory it's returning correctly, but what i am really looking for is what you prescribed which was to return the actual number in the column and a blank if it's outside the criteria (blank if it's not >=1 and the actual data point number if it is >=1). What am i doing wrong?
Below is the formula i used. Thanks in advance
It looks it has to do with your column name where the operator >= 1 is interfering with the DAX [Days Late by BU >= 1]. Can you try changing it by either removing ">= 1" operator or replacing the spaces with underscores?
e.g. [Days_Late_by_BU_>=_1] or simply
[One or more days late] =
if(
NPW[Days Late HR]>=1,
NPW[Days Late HR],
BLANK()
)
Of course! Simple enough. That worked and all my numbers are what i need them to be. THANK YOU!
User | Count |
---|---|
82 | |
79 | |
66 | |
49 | |
46 |
User | Count |
---|---|
103 | |
44 | |
39 | |
39 | |
39 |