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

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.

Reply
aAmirkHan
Helper I
Helper I

Average amount is reflecting in blank year

Hi Sir,

 

I have a year column from 1996 to 1998 in my data. When I calculate net sales then it works fine, however when I calculate Average Net Sales on year wise then it shows values which does not have year in table chart.

 

My Net Sales formula:

Net Sales =
Var gross = SUMX(Order_Details,Order_Details[Quantity]*Order_Details[UnitPrice])
Var discount = SUMX(Order_Details,Order_Details[Quantity]*Order_Details[UnitPrice]*Order_Details[Discount])
Return
gross - discount
 
Average Sales:
 AverageX Sales = AVERAGEX(ALL('Calendar'[Year]),[Net Sales]) 
 
Could you please help me why I am getting additional value apart from below year?
 
 

 

 
 
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@aAmirkHan , Make sure both of these are meausres (changed second measure) and there join with date table

 

Net Sales =
Var gross = SUMX(Order_Details,Order_Details[Quantity]*Order_Details[UnitPrice])
Var discount = SUMX(Order_Details,Order_Details[Quantity]*Order_Details[UnitPrice]*Order_Details[Discount])
Return
gross - discount

Average Sales:
AverageX Sales = AVERAGEX(values('Calendar'[Year]),[Net Sales]) 

View solution in original post

2 REPLIES 2
aAmirkHan
Helper I
Helper I

Amazing Sir, it clears my doubt.
Thank you

amitchandak
Super User
Super User

@aAmirkHan , Make sure both of these are meausres (changed second measure) and there join with date table

 

Net Sales =
Var gross = SUMX(Order_Details,Order_Details[Quantity]*Order_Details[UnitPrice])
Var discount = SUMX(Order_Details,Order_Details[Quantity]*Order_Details[UnitPrice]*Order_Details[Discount])
Return
gross - discount

Average Sales:
AverageX Sales = AVERAGEX(values('Calendar'[Year]),[Net Sales]) 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.