Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have a table like the below and want to setup a calculated column with DAX to check whether each key from the "Concat" column has a value or not.
For example:
- po1drop1 has 2 rows, with 1 row has Value=100, so I want the Result=Yes
- podrop2 has 1 row only with blank value, so I want the Result=No
- podrop3 has 2 rows, with 1 row has Value=100, so I want the Result=Yes
- podrop4 has 2 rows, with 1 row has Value=100, so I want the Result=Yes
- podrop5 has 1 row only with blank value, so I want the Result=No
- podrop6 has 1 row only with blank value, so I want the Result=No
Not sure how to put the FILTER or EARLIER function in place in order to achieve the desired result.
Can anyone assist? Thanks.
Best regards,
Emily
Solved! Go to Solution.
@Anonymous , Try a new column
if(sumx(filter(table,[concat]=earlier([concat])),[Value])=100 ,"Yes","No")
or
if(maxx(filter(table,[concat]=earlier([concat])),[Value])=100 ,"Yes","No")
Hi @Anonymous ,
Glad that the solutions works for you.
Can you accept it as a solution so that others can refer it later?
Thanks,
Pragati
Hi @Anonymous ,
You can create a calculated column using DAX as follows:
@Pragati11 Thanks, I just tested your result in my file but I got the entire column with "Yes".....not sure if I did something wrong in the formula?
Best regards,
Emily
Hi @Anonymous ,
What's the datatype of your "VALUE" column? Is it wholenumber or text?
Thanks,
Pragati
Hi @Anonymous ,
Not sure why it is not working at your end.
I have tried the same formula when VALUE column is a string or numeric, it works for me.
Can you check again as the DISTINCTCOUNTNOBLANK will work both for String and numeric columns?
Thanks,
Pragati
@Pragati11 Would you mind to share your PBIX file with the solution so that I can test it from my end? Thanks!
Best regards,
Emily
HI @Anonymous ,
There you go:
Thanks,
Pragati
The proposed solution is working fine now, thank you very much! @Pragati11 @amitchandak
Best regards,
Emily
Hi @Anonymous ,
Glad that the solutions works for you.
Can you accept it as a solution so that others can refer it later?
Thanks,
Pragati
@Anonymous , Try a new column
if(sumx(filter(table,[concat]=earlier([concat])),[Value])=100 ,"Yes","No")
or
if(maxx(filter(table,[concat]=earlier([concat])),[Value])=100 ,"Yes","No")
Sorry that I found out your proposed solution is not 100% working in my real enviroment, because the Value column is a string type rather than numerical type so I can't use SUMX or MAXX fuction.
Any other way to get the same result in considering the Value column is a string?
Best regards,
Emily
@Anonymous , Maxx will work for String. Do you want sum up value to check?'if it have only numeric that you can try [Value]*1
@amitchandak Thanks for your proposed solution and both formulas working well. Have a great day!
Best regards,
Emily
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
25 | |
20 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |