Forum Discussion
AVERAGE
- Anonymous4 years ago
Hi rwong1 ,
Sample data:
Here's my solution.
1.Create a YearMonth column and a sort column. The sort column is used to sort the YearMonth column.
YearMonth = FORMAT([Date],"YYYY-MMM")sort = VALUE(FORMAT([Date],"YYYYMM"))2.Then you can drag the NFE column directly into the table and get the average.
3.Or you can create a measure.
Measure = CALCULATE(AVERAGE('Table'[NFE]),ALLEXCEPT('Table','Table'[YearMonth]))The line chart:
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
if you use the function AVERAGE, it will calculate the average. You will also need a Year-Month column to be used in the visual. Create this calculated column in the table:
Year-Date = YEAR([Date]) & "-" & FORMAT([Date], "MM")
[Date] will be replace by the column in your table that has the date.
Than plot a line chart or a table using Year-Date and the measure you have created.
Hi,
I just tried that and got the following error:
- rwong14 years ago
Helper III
The Date is a date type, not a text type. I checked.
- Tutu_in_YYC4 years ago
Super User
Use Year-Month as data type Text and visualize that.
For future reports, i recommend having a separate date/calendar table
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/- rwong14 years ago
Helper III
It still didn't work. Please advise.