Forum Discussion

rogerthat's avatar
rogerthat
Helper I
3 years ago

Average for DAX Column Incorrect

Hi,

 

I'm trying to re-create the measure below but in DAX formula so the averge is correct.

 

This is my measure formula:

_Average Corrected =
CALCULATE(
    AVERAGEX(
        SUMMARIZE( 'Employee Data v2',  'Employee Data v2'[Emp ID], 'Employee Data v2'[Swipe Data v2.Attribute]),
        CALCULATE( AVERAGE('Employee Data v2'[__Avg/Wk Average/Week Normalized]) )
    )
)
 
 
This is my DAX column formula:
__Avg/Wk Average/Week Normalized =
CALCULATE(  
    AVERAGE('Employee Data v2'[_Avg/Wk Average Days/Week]),
       ALLEXCEPT('Employee Data v2','Employee Data v2'[Swipe Data v2.Attribute],'Employee Data v2'[Emp ID])
)
 
 
And whenever I place the data in a table, my average for _Average Corrected is fine.
 
However, for __Avg/Wk Average/Week Normalized it is not the exact value. 

 

 
 
 
Data I'm working with:
Swipe Data v2.AttributeEmp ID_Average CorrectedAverage of __Avg/Wk Average/Week Normalized
1/1/202310.50.5
1/1/2023200
1/1/2023300
2/1/2023100
2/1/2023200
2/1/2023300
3/1/2023100
3/1/2023200
3/1/2023300
4/1/2023100
4/1/202320.30.3
4/1/2023300
5/1/202310.20.2
5/1/2023200
5/1/202330.20.2
6/1/202310.50.5
6/1/2023200
6/1/2023300

 

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  rogerthat ,

     

    Sorry, I can't reproduce your scene, in the data I created, [__Avg/Wk Average/Week Normalized] and [_Average Corrected] appear the same value, there are no two inconsistencies.

     

    Can you show a sample of [_Avg/Wk Average Days/Week] or share a sample pbix after removing sensitive data, we can help you better.

     

    Best Regards,

    Liu Yang

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