Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
rwong1
Helper III
Helper III

AVERAGE

Hi,

 

How do I create another table that shows the monthly average of the NFE by month and year?  I then will convert that to a line chart.  Here is the sample data:

 

rwong1_0-1647490168683.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @rwong1 ,

 

Sample data:

vstephenmsft_0-1647847890809.png

 

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"))

vstephenmsft_1-1647847970103.png

 

2.Then you can drag the NFE column directly into the table and get the average.

vstephenmsft_2-1647848031176.png

 

3.Or you can create a measure.

Measure = CALCULATE(AVERAGE('Table'[NFE]),ALLEXCEPT('Table','Table'[YearMonth]))

vstephenmsft_3-1647848077497.png

 

The line chart:

vstephenmsft_4-1647848111223.png

 

 

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.

 

View solution in original post

47 REPLIES 47
Anonymous
Not applicable

Hi @rwong1 ,

 

Sample data:

vstephenmsft_0-1647847890809.png

 

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"))

vstephenmsft_1-1647847970103.png

 

2.Then you can drag the NFE column directly into the table and get the average.

vstephenmsft_2-1647848031176.png

 

3.Or you can create a measure.

Measure = CALCULATE(AVERAGE('Table'[NFE]),ALLEXCEPT('Table','Table'[YearMonth]))

vstephenmsft_3-1647848077497.png

 

The line chart:

vstephenmsft_4-1647848111223.png

 

 

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.

 

rwong1
Helper III
Helper III

Hi,

It only picked up the last value.  It did not do the average.  Please advise.

 

rwong1_0-1647528196416.png

 

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:

 

rwong1_0-1647532371824.png

 

The Date is a date type, not a text type.  I checked.  

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/

It still didn't work.  Please advise.

Can you provide the pbix?

 

Is there any other way to do this besides sharing the file?  It has confidential info in it.  

See if this helps ( or if this is what you are trying to achieve )

Tutu_in_YYC_1-1647545444615.png

 

 

Yes exactly.  How do I get to this?  My date format is a little different.

Can you provide a snapshot of just your [Posting Date_1] column? I think that is your issue here. I assume it will look something like this : 3/16/2021-03 and it is not a date type

Tutu_in_YYC_0-1647545753660.png

 

 

 

Sure.  See below:

 

rwong1_0-1647546043333.pngrwong1_1-1647546086340.png

 

That looks good. What about the calculated column?

Tutu_in_YYC_0-1647546285511.png

 



Sorry I also want to average it by client which is equivalent to your column called "person."

Just add client column into the table

 

Tutu_in_YYC_0-1647548506590.png

 

Ok, now there is no error.  Not sure what happened.

 

rwong1_0-1647548122351.png

 

Can you provide me with the formula for the measure?  

 

AverageNFE = AVERAGE( TableName[NFE])

 

But the NFE is a measure.  I won't find it in a table.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.