Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live 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
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 43 | |
| 30 | |
| 27 | |
| 23 |
| User | Count |
|---|---|
| 134 | |
| 114 | |
| 58 | |
| 39 | |
| 35 |