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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. 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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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