Forum Discussion
vbvbvb
Microsoft Employee
3 years agoHelp with creating column which calulcates averrage values based on month + year value
Hello community, Trying to see if there's a n easy way to implement column with DAX calculating following: There is a table with a item, 50-60 per month, I want to calculate average values f...
- 3 years ago
Hi,
Please check the below picture and the attached pbix file.
AVG value CC = VAR _newtable = FILTER ( Data, Data[Year] = EARLIER ( Data[Year] ) && Data[Month] = EARLIER ( Data[Month] ) ) RETURN SUMX ( _newtable, Data[Values] ) / COUNTROWS ( _newtable )
vbvbvb
Microsoft Employee
3 years agoAs suspected, this was an issue with format of these two columns -- I did new extraction of year + month and your DAX worked, thanks!
If I want to add extra argument to FILTER to also only consider another column for this calculation, for example if column = "Test" text value, can I add it directly to this formula?
Jihwan_Kim
Super User
3 years agoHi,
Thank you for your reply, and I think it will work. If not, please share your sample pbix file and then I can try to look into it.
Thanks.
- vbvbvb3 years ago
Microsoft Employee
It did, i checked and seems that your solution was spot on , thansk once again!