Power BI is an incredibly useful tool when it comes to making calculations. However, quite a few users are encountering issues with adding a calculated column in Power BI.
Download DriverFix (verified download file).
Click Start Scan to find all problematic drivers.
Click Update Drivers to get new versions and avoid system malfunctionings.
DriverFix has been downloaded by 0 readers this month.
One user described the problem on the official forum:
So, the OP wants to add a new column that will allow a new calculation. Today we will show you how to do that in a few easy steps.
I’m quite new with Power Bi and i am using a matrix to group my data like this (image below). Now I want to add a new column which allow me to make a new calculation = ([q’ty per unit of 3rd month] – [q’ty per unit of 2nd month]) * [Price per Unit of 3rd month] Is there any simple way help me to do so since I’m not an expect with DAX. Thanks for your help.
Steps to add a calculated column in Power BI
1. Create a measure using DAX
DAX stands for Data Analysis Expression and it is the formula language in Power BI. Here you can add functions and formulas for your columns like in the image below.
In the upper case (second arrow), add the following:
Adapt the values to make the formulas work for your case.
Result = VAR qty_per_unit_of_3rd_month = CALCULATE ( MAX ( Table[q’ty per unit] ), FILTER ( Table, Table[Month] = 3 ) ) VAR qty_per_unit_of_2rd_month = CALCULATE ( MAX ( Table[q’ty per unit] ), FILTER ( Table, Table[Month] = 2 ) ) VAR Price_per_Unit_of_3rd_month = CALCULATE ( MAX ( Table[Price per Unit] ), FILTER ( Table, Table[Month] = 3 ) ) RETURN qty_per_unit_of_3rd_month – qty_per_unit_of_2rd_month * Price_per_Unit_of_3rd_month
This guide will make you a better Power BI user. Do check it out now.
2. Apply the measure directly to the slicer
You can also modify the measure as below:
The second measure applies directly to the slicer, so you can compare different months, such as the first and the last.
Result = VAR qty_per_unit_of_first_month_in_slicer = CALCULATE ( MIN ( Table[q’ty per unit] ), ALLSELECTED ( Table ) ) VAR qty_per_unit_of_last_month_in_slicer = CALCULATE ( MAX ( Table[q’ty per unit] ), ALLSELECTED ( Table ) ) VAR Price_per_Unit_of_last_month = CALCULATE ( MAX ( Table[Price per Unit] ), FILTER ( Table, Table[Month] = qty_per_unit_of_last_month_in_slicer ) ) RETURN qty_per_unit_of_last_month_in_slicer – qty_per_unit_of_first_month_in_slicer * Price_per_Unit_of_last_month
Conclusion
With calculated columns, you can organize and visualize your data in various ways. But first, you need to know a few basic principles and measures for these columns. They are pretty easy to work with once you get to understand them.
How do you add calculated columns in Power BI? Do let us know in the comments section below!
RELATED ARTICLES YOU NEED TO CHECK OUT:
- How to add filters in Power BI [EASY STEPS]
- 5 free cloud accounting software to keep your books updated on the fly
- Stuck with Math? Use these best software to write mathematical equations
If the advices above haven’t solved your issue, your PC may experience deeper Windows problems. We recommend downloading this PC Repair tool (rated Great on TrustPilot.com) to easily address them. After installation, simply click the Start Scan button and then press on Repair All.
Still having issues? Fix them with this tool:
SPONSORED
- PowerBi tutorials and guides
Email *
Commenting as . Not you?
Comment