Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ChPetru
Helper I
Helper I

Divide each row value to the average of the column

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 NameOpportunityAverage DiscountAverage difference
ABC166.72%1,61%
ABC260.40%-4.71%
ABC362.65%etc.
ABC478.80% 
CDE553.10% 
CDE653.10% 
CDE668.18% 
CDE775.04% 
CDE868.00% 
  65.11% 

 

Appreciate any help.

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@ChPetru,

 

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

 

DataInsights_0-1644854019711.png

---------------------------------------------------------

 

DataInsights_1-1644854037085.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@ChPetru,

 

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

 

DataInsights_0-1644854019711.png

---------------------------------------------------------

 

DataInsights_1-1644854037085.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks so much!!!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors