Forum Discussion

b_koe's avatar
b_koe
New Member
1 year ago

DAX Divide Measure producing same value for all categories when a filter is applied

Hello, 

 

I have a column of data that is in decimal form and I need an average of it, I do not want it to sum so I have used the following measure.

 

Default PF = DIVIDE(SUM('DPS 20240816'[DefaultProductivity2]), COUNT('DPS 20240816'[DefaultProductivity2]))
 
This works to provide an average for each category when no other filters are on, but as soon as I filter by another category in my data source, all the values become equal and doesn't calculate properly. All my relationships seem to be defined properly, so I'm assuming it is an issue in the measure. Image below for reference when a filter is applied to a matrix vs the total.
 

 

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi b_koe ,

    Try below measure

    Default PF = AVERAGEX(
    'DPS 20240816',
    'DPS 20240816'[DefaultProductivity2]
    )

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi b_koe ,

    Try below measure

    Default PF = AVERAGEX(
    'DPS 20240816',
    'DPS 20240816'[DefaultProductivity2]
    )

    • b_koe's avatar
      b_koe
      New Member

      Unfortunately, still having the same issue. The outcome is identical to my posted measure above. Thanks

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi b_koe ,

        I have changed the measure please check and try with the below

        Default PF = CALCULATE(
        AVERAGE('DPS 20240816'[DefaultProductivity2]),
        ALL('DPS 20240816')
        )

    • suparnababu8's avatar
      suparnababu8
      Super User

      Thanks for your reply Anonymous . Ideally it should works. b_koe  Make sure to have proper relationships.
      If you need solution, pls post detailed question with out any sentive data.