Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
101 | |
75 | |
63 | |
62 |
User | Count |
---|---|
141 | |
104 | |
101 | |
80 | |
67 |