Forum Discussion

clarafff's avatar
clarafff
Frequent Visitor
3 years ago

why the average function is not working , both the average function on visualization and Dax

Hi Guys, 

could you help me check what is the problem, my average function is not working on the report. No matter I use the average function on the visualisation field or write the Dax.I want to count the daily average actives. But it just shows ' 1 ' on the result. what kinds of reasons could be ? I have checked the data type, filters ...I don't know why it is like that

 

7 Replies

  • Hi clarafff 

     

    Download example PBIX file

     

    Not sure what you are doing because it works ok for me - please see example PBIX file above.

     

     

    You've got a date Table connected to the Fact_seo_user table?

     

    I'd need to see your file to check any further.

     

    Regards

     

    Phil

    • clarafff's avatar
      clarafff
      Frequent Visitor

      exactly, the function is working on another report, but not working on this one, I wonder what's the problem ? yes , the tables are connected....

  • Hi clarafff, if you look closely on the selected table, you'll notice the header of the first column "First YEAR_MONTH". If this name has been created automatically there might be an issue with a column data type. "First" means that PowerBI is selecting the first available row with value "2023_05" within column "YEAR_MONTH", therefore the whole table has only 1 row. So your average is correct, as denominator of calcualation is 1. I can't tell you why SUM is working, as I need to see its DAX code before. 

    Try to replace "First YEAR_MONTH", for example, to "Country". If the average works, you indentified where the issue is (column "YEAR_MONTH").

    If wrtitten above is not a case, pay a close attention to filteter context of your visual: make sure that this context is indeed what you expect (I suggest you to filter all columns one by one accordingly in Data tab to ensure that the final filtered table is the one you expect to apply Average formula on).

    Hope it helps!