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.
I am calculating the Average Profit Margin for a dataset of Films that I have.
There are two measures which I believe should give same results, but they are not.
First Measure is as follows,
Average Profit Margin = DIVIDE([Average Box Office (m)] - [Average Budget (m)], [Average Box Office (m)], BLANK())
Average Box Office (m) = AVERAGE(Films[BoxOfficeDollars]) / 1000000
Average Budget (m) = AVERAGE(Films[BudgetDollars]) / 1000000
The second Measure is as follows,
Average Profit Margin AverageX = AVERAGEX(Films, DIVIDE(Films[BoxOfficeDollars] - Films[BudgetDollars], Films[BoxOfficeDollars], BLANK()))
Now, they are being used in the same Filter Context (as far as I understand), but their results are far different from each other. Following is the result that I am getting,
I fail to understand why they are giving different results. Can anybody help me out in understanding this?
If you would like to take a look at the dataset or the Workbook, you can download the complete Workbook from here:
https://drive.google.com/file/d/1NFBEiRtzs7BrOFGyNESPmcWrf49yD8C7/view?usp=sharing
@HassanAshas , Averagex will do line level calculation the correct way for this
DIVIDE(Sum(Films[BoxOfficeDollars]) - Sum(Films[BudgetDollars]), Sum(Films[BoxOfficeDollars]))
refer
https://radacad.com/sum-vs-sumx-what-is-the-difference-of-the-two-dax-functions-in-power-bi
I understand the difference and I read the article as well, I still don't get it though.
I understand that AVERAGEX will first calculate the difference row-by-row and then take the average of all the differences calculated.
Whereas in Average function, you already have all the Averaged values and then you are taking the Difference of those. But that shouldn't cause any problem, should it? Because the filter context is still the same for both the scenarios.
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 |
---|---|
81 | |
80 | |
60 | |
35 | |
35 |
User | Count |
---|---|
100 | |
60 | |
56 | |
46 | |
41 |