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,
I want to calculate the square difference between the discount at row level vs. average of the column discount. Can you please help me with a function that calculates this?
Note that I want to be able to change filters and columns, so the measure should dynamically calculate: Average Discount - Column Total Average Discount, regardless of the other filters or columns I add to the visual.
Data looks like this:
Account Name | Opportunity | Average Discount | Average difference |
ABC | 1 | 66.72% | 1,61% |
ABC | 2 | 60.40% | -4.71% |
ABC | 3 | 62.65% | etc. |
ABC | 4 | 78.80% | |
CDE | 5 | 53.10% | |
CDE | 6 | 53.10% | |
CDE | 6 | 68.18% | |
CDE | 7 | 75.04% | |
CDE | 8 | 68.00% | |
65.11% |
Appreciate any help.
Solved! Go to Solution.
Try this measure:
Average Difference =
VAR vAvgDiscount =
MAX ( Table1[Average Discount] )
VAR vTotalAvgDiscount =
CALCULATE ( AVERAGE ( Table1[Average Discount] ), ALLSELECTED () )
VAR vResult = vAvgDiscount - vTotalAvgDiscount
RETURN
vResult
---------------------------------------------------------
Proud to be a Super User!
Try this measure:
Average Difference =
VAR vAvgDiscount =
MAX ( Table1[Average Discount] )
VAR vTotalAvgDiscount =
CALCULATE ( AVERAGE ( Table1[Average Discount] ), ALLSELECTED () )
VAR vResult = vAvgDiscount - vTotalAvgDiscount
RETURN
vResult
---------------------------------------------------------
Proud to be a Super User!
Thanks so much!!!
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 |
---|---|
58 | |
55 | |
55 | |
37 | |
30 |
User | Count |
---|---|
78 | |
64 | |
45 | |
42 | |
40 |