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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Avivek
Post Partisan
Post Partisan

Last 6 month weighted average total is inaccurate

I tried to create a measure of last 6 month weighted average days, the measure is as follows;

Wt avg 2 = CALCULATE(SUMX(RECEIVABLES,RECEIVABLES[Days Diff]*RECEIVABLES[Weights]))

 
Last 6 months Wt Avg4 =
VAR enddate = EOMONTH('LAST REFRESHED'[Data Last Refreshed],-1)
VAR startdate = EOMONTH(enddate,-6)+1
return
CALCULATE( [Wt avg 2],
FILTER('RECEIVABLES','RECEIVABLES'[Payment Recieved date]>= startdate && RECEIVABLES[Payment Recieved date]<= enddate))
Capture.PNG
If I check them individually, the 6 month weighted average shows correct value, showing me the last 6 month weighted average days as well as every month's weighted average days is also correct. But the total for the 6 month is incorrect and also does not match with the invidual values for the last 6 months.
1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Avivek ,

 

The calculated logic of total value of [Last 6 months Wt Avg4] measure works like what I explained in this post. Please refer.

 

You can try the measure as follows. Make sure replace Table with the actual name of the table.

New measure = SUMX(Table,[Last 6 months Wt Avg4])

This may give the same values in the rows, but the correct sum in total.

 

 

Best regards

Icey

 

If this post helps,then consider Accepting it as the solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
Icey
Community Support
Community Support

Hi @Avivek ,

 

The calculated logic of total value of [Last 6 months Wt Avg4] measure works like what I explained in this post. Please refer.

 

You can try the measure as follows. Make sure replace Table with the actual name of the table.

New measure = SUMX(Table,[Last 6 months Wt Avg4])

This may give the same values in the rows, but the correct sum in total.

 

 

Best regards

Icey

 

If this post helps,then consider Accepting it as the solution to help other members find it more quickly.

dedelman_clng
Community Champion
Community Champion

Hi @Avivek  - 

 

Power BI tables/matrixes don't "sum" the way Excel does - they evaluate the measure in the context of the "total" for that visual, which often gives unexpected results, especially when dates are otherwise involved in the table.

 

What do you expect to see where you have circled the value?

 

David

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.