Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet 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
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.
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.
Solved! Go to Solution.
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
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:
Best Regards,
Teige
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
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
92 | |
83 | |
71 | |
49 |
User | Count |
---|---|
143 | |
120 | |
110 | |
59 | |
57 |