Forum Discussion

Rastelka's avatar
Rastelka
New Member
3 years ago
Solved

All Function in AverageX

Hello everyone,

 

I am new to DAX and would appreciate a bit of help. Why these two meassures produce two different results in Power BI report? Thanks a lot for any answer. 

 
(First Picture)
PriemerProdukt = AVERAGEX('Product', SUMX ( RELATEDTABLE(Sales), Sales[Quantity] * Sales[Net Price] ))
 
 
(Second Picture)
PriemerALL =
AVERAGEX(ALL('Product'), SUMX ( RELATEDTABLE(Sales), Sales[Quantity] * Sales[Net Price] ))
 

 

Thanks a lot. 

  • Hi,

    ALL removes the filter context in your calculation and because of that the row level filter context that is available in your table is removed and all rows return the same result.

    I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

    My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/

  • hi Rastelka 

    ALL removes the filter context in any calculattion, like AVERAGX, not only in CALCULATE function. 

    In your first measure, Product table is filtered by the row filter of the table visual.

4 Replies

  • ValtteriN's avatar
    ValtteriN
    Community Champion

    Hi,

    ALL removes the filter context in your calculation and because of that the row level filter context that is available in your table is removed and all rows return the same result.

    I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

    My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/

  • Hello,

     

    I thought that ALL removes the Filter Context only when it's used with Calculate. Or is that incorrect? Thanks a lot!

    • FreemanZ's avatar
      FreemanZ
      Super User

      hi Rastelka 

      ALL removes the filter context in any calculattion, like AVERAGX, not only in CALCULATE function. 

      In your first measure, Product table is filtered by the row filter of the table visual.