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
binerd
Frequent Visitor

Average Measure not Calculating Correctly HELP!

Hello, I am using a measure to calculate average units for the last 90 days:

 

90 DayAvgUnits = DIVIDE(calculate(SUMX(SALES,SALES[SHIPPED_QTY]),
FILTER(ALLSELECTED(SALES),
SALES[INVOICE_DATE]>max(SALES[INVOICE_DATE])-90 &&
SALES[INVOICE_DATE]<= MAX(SALES[INVOICE_DATE]))),3)
 
But the row total is not calculating properly, and repeating random values.  What am I missing?
 
binerd_0-1659555967302.png

 

1 ACCEPTED SOLUTION
binerd
Frequent Visitor

Hi I was able to figure out a solution as all the values weren't populating correctly.

90 Day Avg Units = divide(CALCULATE(SALES[Total Units], ALL(CALENDAR[DATE_AT]), CALENDAR[DATE_AT]>=-90),3)

View solution in original post

3 REPLIES 3
binerd
Frequent Visitor

Hi I was able to figure out a solution as all the values weren't populating correctly.

90 Day Avg Units = divide(CALCULATE(SALES[Total Units], ALL(CALENDAR[DATE_AT]), CALENDAR[DATE_AT]>=-90),3)
Anonymous
Not applicable

Hi  @binerd ,

If only the toal values is not correct, you can create another new measure as below and put this new measure to replace the original measure [90 DayAvgUnits] onto the table visual...

Measure =
SUMX (
    GROUPBY ( 'SALES', 'SALES'[CATEGORY], 'SALES'[level2field] ),
    [90 DayAvgUnits]
)

 

In addition, you can refer the following links to try to solve your problem...

Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

Dax for Power BI: Fixing Incorrect Measure Totals

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

littlemojopuppy
Community Champion
Community Champion

 @binerd can you provide a sample pbix to play with?  Hard to reply without seeing the data model.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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