cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
bigman24 Frequent Visitor
Frequent Visitor

DATEINPERIOD with AVERAGE or AVERAGEX Rounding Issue

Hello Power BI Community,

 

I am buiding a report that has a measure of weekly values that are derived by a few calculated measures which are derived by fixed column values.  Think dollar amounts calculated to generate O/S numbers and then the O/S numbers are used in a formula to come up with a 0.xxxxx value. 

 

These values are displayed on a weekly basis for the entire quarter and then calculated on a BI-Weekly basis (so I dont think I can use the Average function in Power BI.  I can get to the exact numbers as displayed in Excel for the weekly numbers, however when I try to calculate the AVERAGE for the two weeks the numbers are slightly off, but it makes a material impact on output which is used for bonuses.  For example I have Values of:

 

Week 1:  0.21470

Week 2:  0.27147

 

The BI-Weekly number I am getting in Power BI is yielding 0.24161.  However, when doing a simple average I get 0.243085.  I've tried several formulas and get different answers, but never the right one.  Can you please help me with this.

 

Closest Formula (I noticed that changing the date period doesn't change the output):

 

Bi-Weekly:= If(ISODD([Week Number]), "-", CALCULATE(AVERAGEX(VALUES('Report Date'[Week Ending]), DIVIDE(DIVIDE([Phy Calc] + [Dmg Calc] + [Gl Calc],5)*100,100)),
DATESINPERIOD (
'Report Date'[Week Ending],
LASTDATE('Report Date'[Date]) ,
-14,
day
)) )

1 REPLY 1
v-yulgu-msft Super Contributor
Super Contributor

Re: DATEINPERIOD with AVERAGE or AVERAGEX Rounding Issue

Hi @bigman24 ,

 

Please illustrate with sample data and show us the desired output.

How to Get Your Question Answered Quickly

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 211 members 2,228 guests
Please welcome our newest community members: