Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello Community,
I need help understanding these two functions first I have created a measure that is
I am sharing that table here please help me
As you can see here there are two tables under the Orders 2 table and I use the same column to get the total profit
Solved! Go to Solution.
Hi @mahendrapal1792 ,
I made a simplified pbix file(see the attachment) to describe the difference between your first function and second function. Your first function is a measure, which is a dynamic calculation that changes based on the filter context of your report. Your measure calculates the total profit by subtracting the product cost from the selling price and multiplying it by the quantity for each row in the Orders 2 table. Your measure is evaluated at query time, which means it will update whenever you change your filters or slicers in your report.
Total profit = (SUM('Orders 2'[Selling Price])-SUM('Orders 2'[Product Cost]))* SUM('Orders 2'[Quantity])
Your second function is a calculated column, which is a static value that is added to an existing table in your data model. Your calculated column calculates the total profit by using the same formula as your measure, but it does not depend on any filter context. Your calculated column is evaluated during data loading, which means it will only calculate once when you load or refresh your data.
Total Profit 2 = (('Orders 2'[Selling Price])-('Orders 2'[Product Cost]))* ('Orders 2'[Quantity])
The reason why you got different values for your two functions is because they are using different contexts. Your measure uses the current context of your report, which may include filters or slicers that affect your data. Your calculated column uses the original context of your table, which does not include any filters or slicers.
Calculated Columns and Measures in DAX
Calculated Columns vs Measures
Best Regards
Hi @mahendrapal1792 ,
I made a simplified pbix file(see the attachment) to describe the difference between your first function and second function. Your first function is a measure, which is a dynamic calculation that changes based on the filter context of your report. Your measure calculates the total profit by subtracting the product cost from the selling price and multiplying it by the quantity for each row in the Orders 2 table. Your measure is evaluated at query time, which means it will update whenever you change your filters or slicers in your report.
Total profit = (SUM('Orders 2'[Selling Price])-SUM('Orders 2'[Product Cost]))* SUM('Orders 2'[Quantity])
Your second function is a calculated column, which is a static value that is added to an existing table in your data model. Your calculated column calculates the total profit by using the same formula as your measure, but it does not depend on any filter context. Your calculated column is evaluated during data loading, which means it will only calculate once when you load or refresh your data.
Total Profit 2 = (('Orders 2'[Selling Price])-('Orders 2'[Product Cost]))* ('Orders 2'[Quantity])
The reason why you got different values for your two functions is because they are using different contexts. Your measure uses the current context of your report, which may include filters or slicers that affect your data. Your calculated column uses the original context of your table, which does not include any filters or slicers.
Calculated Columns and Measures in DAX
Calculated Columns vs Measures
Best Regards
pls change the measure to
total profict = sumx('Table',('Table'[selling price]-'Table'[product cost])*'Table'[quantity])
pls see the attachment below
Proud to be a Super User!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
76 | |
60 | |
36 | |
33 |
User | Count |
---|---|
91 | |
60 | |
59 | |
49 | |
45 |