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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dajuju
Frequent Visitor

Can't get TOTALYTD to work for sales of multiple outlets

I have 5 different stores and each maintains separate sales tables with daily sales data.

 

I have combined them using appended tables to come up with a single table with all sales for all stores.

 

I have been able to succesfully generate Month to Date data using the TOTALMTD() function but can't, for the life of me, figure out how to get Year to Date from the same data with TOTALYTD. I've tried a new column and new measure, but it won't return anything but null values, or if at all, it just generates Month to Date data.

 

Here is a small table as an example (let's call this table 'SALES':

I have the date data linked to a separate date table (let's call this 'Calendar').

 

Screen Shot 2019-11-15 at 2.58.04 PM.png

I've been using YTD Sales = TOTALYTD(sum('SALES'[Sales]),'Calendar'[date]).

 

My data set is obviously larger than the sample but I can't get it to work. I can't generate YTD for the entire set and I can't generate YTD per store from the measure.

 

Any suggestions?

 

Thanks

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Ensure that you drag Month and Year from the Calendar Table and select any one month and year.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
saraMissBI
Resolver I
Resolver I

Hi @dajuju 

I do not see a year in your Date column (just day and month). Your data is obviously missing the year, so that's why the function cannot calculate the YTD. 

Regards,

This is just an example table.

 

My full table has complete mm-dd-yy info and is linked to a complete date data table.

Anonymous
Not applicable

Do you have DATE table? and marked as 'Mark as Date Table' under Modeling tab ?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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