Forum Discussion
IF Formula Help
erhan_79 there are many ways to do it, I can give you the answer but provide a proper solution I need to know:
- Is this group value unique between in both the tables?
- Is this group value unique in Table B table if not in the both?
- What is the logic that you only need install cost for Product A.
As I said , there are many ways to resolve it but once I have the answer of above questions, I can provide your effective solution.
- erhan_796 years ago
Post Prodigy
dear parry2k ;
i tried to explain your questions as below under your questions :
-Is this group value unique between in both the tables?
Yes
- Is this group value unique in Table B table if not in the both?
Yes it is unique too.
- What is the logic that you only need install cost for Product A.
İnfact i have a huge issue sure , just i needed to show a limited example ,you should imagine like that let me explain pls;
i have two tables ,and in these both table there are "Group" columns which has unique values.In "Table A " there is "Install Cost" column also but in "Table B" there is no "Install Cost" column.So i would like to create " Install Cost " column in "Table B" .But while creating i just want to see on these column's inside " 20A" 's (Group ) cost only.Other Group's (20B or 20C) value i dont want to see in table B new created "install cost" column
i hope it is clear
- ryan_mayu6 years ago
Super User
Please see if this is what you want.
Column = IF(TableB[Group]="20A",LOOKUPVALUE('TableA'[InstallCost],TableA[group A],TableB[Group]),0)- parry2k6 years ago
Super User
erhan_79 I would recommend to set relationship between both the tables on group column and it will be 1-1 relatioship since group value is unique
and now you can simply add the column
New Install Code = IF ( TableB[Group] = "20A", RELATED ( TableA[Install Cost ), 0 )Lookup can be very slow and that was the reason I asked those questions, I don't like to give the answers without knowing the full scenario.
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡