Scenario 1: Sundays have an additional 10% premium (requires basic logic).In this example, we will be calculating the value assuming the following: Select any cell in that Table and click Data -> From Table/Range to load the data into Power Query. The examples in this post use the file called Example 15 – If Function.xlsx The Example Then you’ll be able to work along with examples and see the solution in action, plus the file will be useful for future reference.ĭownload the file: Power Query – Example Files I recommend you download the example file for this post. Writing M code for more advanced if logic.Using the conditional column feature for basic if logic.However, if you’re coming from a purely Excel world this may be new to you. If you’ve ever programmed VBA or other languages, you will be familiar with this approach. To use Power Query if logic, we need a programming based methodology, rather than tje function based methodology we find in Excel. Surely there is an if function… right? … well, kind of. Last week, we looked at Functions in Power Query, but we didn’t cover a Power Query version of the IF function. In Excel, IF is a core function, it’s one of the first ones we learn. In a previous post, we briefly looked at the if statement in Power Query, now we’re going to dig a bit deeper and understand how the Power Query if really works.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |