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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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