This page contains the process of generating calculated measures and conditional columns that are meaningful for the business.
DAX is the formula language driving the Power BI front-end. It is mainly used to create:
<aside> <img src="/icons/report_orange.svg" alt="/icons/report_orange.svg" width="40px" />
M-code on the other hand, is a back-end language focused on the ETL process undertaken with Power Query Editor.
</aside>
The step-by-step process for this stage of the project are mentioned as follows:
Created a dedicated measures table (Home Ribbon → Enter data → Create Table)
Creating a Quantity Sold measure, that sums orders based on filter context.
Creating a Quantity Returned measure, that sums returns based on filter context.
Creating Average Retail Price measure, that averages the product price based on filter context.
Creating a Returns Made measure, that counts the orders returned (irrespective of quantity) based on filter context.
Creating a Orders Made measure, that distinctly counts the orders made based on filter context.
Creating a Customer measure, that distinctly counts the number of customers involved in a transaction.
Creating a Return Rate measure by dividing Quantity Returned with Quantity Sold.
Creating a Bulk Orders measure to only focus on orders where Orders Made > 1, using CALCULATE( ).
Bulk Orders = CALCULATE(
[Orders Made], # Previously defined explicit measure '6'
'Sales Data'[OrderQuantity] > 1 # "Forced" filter context to override the natural context
)