Forum Discussion
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
- PhilipTreacySuper User
Hi clarafff
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
- clarafffFrequent 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....
- PhilipTreacySuper User
- Sergii24Super User
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!- clarafffFrequent Visitor
Hi Sergii24,
I have tried many ways, but I'm still not be able to find the probelm . Could you please help me check what is wrong with my file?Active users.pbix - Google Drive
- Sergii24Super User