The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have two tables, where i need to create a custom column in table1 with Xlookup and if condition as below in power query.
Any suggestion is appreciated!
XLOOKUP(Table1[Acct],IF(Table1[Code]="10",Table2[ID],Table2[Reg]),Table2[Result],"",0) - as excel formula
@amitchandak @Greg_Deckler any idea ?
PFB, example
Solved! Go to Solution.
Yes, you can do it in power query
For it
watch my video here
https://1drv.ms/v/s!AiUZ0Ws7G26RhkVJy1BzMCewswHT?e=IhiBz9
Sample PBIX file attached
https://1drv.ms/u/s!AiUZ0Ws7G26RhkSmF2LtunIY-yJ1?e=wcPPjd
Yes, you can do it in power query
For it
watch my video here
https://1drv.ms/v/s!AiUZ0Ws7G26RhkVJy1BzMCewswHT?e=IhiBz9
Sample PBIX file attached
https://1drv.ms/u/s!AiUZ0Ws7G26RhkSmF2LtunIY-yJ1?e=wcPPjd
1) creat new tabl
Table = ALLSELECTED('Table_1'[Acct],Table_1[Code])
or
Newtable = VALUES(Table_1)
2) add column
Column =
IF([Code]=10, CALCULATE(MAX('Table_2'[Result]),FILTER(ALL(Table_2),'Table_2'[ID]=[Acct])),
CALCULATE(MAX('Table_2'[Result]),FILTER(ALL(Table_2),'Table_2'[Reg]=[Acct]))
)
is there any possible way in power query itself ?