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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Average - Year to Date

Dear,

I need a help in doing the YTD media, and for the current year (2019) I have value until February, for other months this is like zero because I do not have the values ​​yet.

 

Screenshot_1.png

As in the picture above I can not count on zeros, however, in a few months of last year for example I have zero that I need to count in YTD.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello Teige,

Thanks for the answer!

 

I'll try to build based on that calendar. But are we bringing in every month of 2019? Well, I need to get them in what you referred to as zero.

 

The year to date would be an average of the year, but in 2019 with the zeroes that have the average.

 

Best Regards, 

Douglas 

View solution in original post

2 REPLIES 2
TeigeGao
Solution Sage
Solution Sage

Hi DouglasFranco,

Could you please share the sample data and expected result to us? Based on my understanding, you want to calculate the average YTD.

In this scenario, we can create a calendar table using the following query:

calendar = ADDCOLUMNS(CALENDARAUTO(),"year",YEAR([Date]),"month",MONTH([Date]),"month/year",FORMAT([Date],"mmm")&"/"&YEAR([Date]))

Then create relationship between calendar table and data table, then we can use the following query to calculate the average YTD:

ytd2018 = TOTALYTD(AVERAGE(Data2018[KPIS]),'calendar'[Date])
ytd2019 = TOTALYTD(AVERAGE(Data2019[KPIS]),'calendar'[Date])

The result will like below:

1212.png

Best Regards,

Teige

Anonymous
Not applicable

Hello Teige,

Thanks for the answer!

 

I'll try to build based on that calendar. But are we bringing in every month of 2019? Well, I need to get them in what you referred to as zero.

 

The year to date would be an average of the year, but in 2019 with the zeroes that have the average.

 

Best Regards, 

Douglas 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.