Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
Hi
I have a table with the following columns Ref, VAT Code, VAT Amount, VAT Amount query119. The table is 100,000 rows long and will continue to grow. I need to create a custom column in power query with an IF Statement to do the following
IF VAT Code = F2 then VAT Amount Query 119 else VAT Amount
I have tried many different combinations but keep receiving an error
| Journal Ref | VAT Code | VAT Amount | VAT Amount - Query 119 |
| 1084523 | D0 | 0 | 1313 |
| 1099880 | D0 | 0 | 40 |
| 1033875 | F2 | 0 | 247 |
| 1056924 | F2 | 0 | 33 |
| 1071960 | F2 | 0 | 2438 |
| 1075097 | F2 | 0 | 400 |
| 1075411 | F2 | 0 | 400 |
| 1098041 | F3 | 0 | 15 |
| 1109724 | F3 | 0 | 31 |
| 1109728 | F3 | 0 | 11 |
| 1101111 | F0 | 204 | 204 |
| 1104774 | F9 | 0 | 1061 |
| 1077322 | N0 | 0 | 145 |
| 1071910 | N2 | 19 | 77 |
| 1077211 | N2 | 793 | 286 |
| 1077322 | N2 | 18 | 72 |
| 1118252 | NN | 0 | 40 |
| 1148406 | NN | 0 | 40 |
| 1077322 | P2 | 62 | 145 |
| 1083805 | P2 | 1963 | 974 |
| 1091893 | P2 | 2336 | 13979 |
| 1094075 | P2 | 1058 | 2004 |
| 343434 | P3 | 113 | 113 |
thank you
Richard
Solved! Go to Solution.
@cottrera , Use conditional column which uses IF , Then and else .
Proud to be a Super User!
Go to Power Query --> Add Column Menu --> Click on Conditional Column and fill like below:
Or Else you can do it using DAX column like below:
Hi Tahreem24 Thank you for your response you suggestion worked perfectly. Unfortunatly someone answered before you and I marked them as resolved
RIchard
@cottrera , Use conditional column which uses IF , Then and else .
Proud to be a Super User!
Thank you manikumar34 for your quick reponse. I always answer in order of who contacted me by date and time. Your option worked aso marked as solution
Richard
@cottrera Add custom column with this code:
if [VAT Code]="F2" then [#"VAT Amount"] else [#"VAT Amount - Query 119"]
Hi Marik thank you for your quick response. I tried the customer column method but received and error
So I then tried manikumar34 option.
thank you anyway
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 20 | |
| 19 | |
| 17 | |
| 11 |
| User | Count |
|---|---|
| 60 | |
| 55 | |
| 42 | |
| 40 | |
| 30 |