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! Get ahead of the game and start preparing now! Learn more
Hi All,
Novice in power query,hope i can get some advise.
I need to calculate pass/fail for different document types based off different date fields.
if doc type equals invoice and invoice date is less than creation date, Fail [Obviously the pass result side of that]
If doc type equals PL and departure date is less than creation date, Fail [Again the pass result of that ]
Not sure how to approach this, hope i am clear in the ask
Many thanks
Solved! Go to Solution.
Hi @DairyG1
Can you provide some sample data and expected result? If you have columns similar to below, you can add a custom column with code similar to below:
if [Doc Type] = "Invoice" and [Invoice Date] < [Creation Date] then "Fail" else if [Doc Type] = "PL" and [Departure Date] < [Creation Date] then "Fail" else "Pass"
Reference: Power Query If statement: nested ifs & multiple conditions (exceloffthegrid.com)
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi @DairyG1
Can you provide some sample data and expected result? If you have columns similar to below, you can add a custom column with code similar to below:
if [Doc Type] = "Invoice" and [Invoice Date] < [Creation Date] then "Fail" else if [Doc Type] = "PL" and [Departure Date] < [Creation Date] then "Fail" else "Pass"
Reference: Power Query If statement: nested ifs & multiple conditions (exceloffthegrid.com)
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
For an easy way to do it, you can break your code up into smaller portions using the conditional column option when you go to Add Column in the PQ menu and then based on the results of the columns created combine the logic or write an if statement in PQ using Custom Column option
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 11 | |
| 7 | |
| 5 | |
| 5 | |
| 3 |