Forum Discussion

MrDaniels's avatar
MrDaniels
Frequent Visitor
2 years ago

YTD Conditional depending on Dimension

Hi gurus,

 

Could you please share some light.

 

I got the current problem, I want to estimate YTD values based on another column. For example, the number of items can be normally aggregated as YTD, but the number of customers always remain the same.

 

I have tried TOTALYTD(SUM(TABLE[VALUE]),TABLE[DATE],YEAR(TABLE[DATE])=YEAR(TODAY())) and this gives me the YTD for Items and customers.

 

Then I tried SUMX(TABLE, IF(TABLE[SUBTYPE] = "CUSTOMERS", AVERAGE(TABLE[VALUE]),TOTALYTD(SUM(TABLE[VALUE]),TABLE[DATE],YEAR(TABLE[DATE])=YEAR(TODAY())), this one didnt give me the YTD for Items.

 

In other words. I just want this:

Create a matrix table where I filter one month at the time, and the YTD measure gives me YTD values for Items but remain the same values for Customers (as these dont change over time).

 

Thanks in advance.

 

Cheers,

 

MrD

2 Replies

  • Hey MrDaniels ,

     

    how is the result of NON-Local customers be calculated?

    Please take the time to create sample data, that can be reused easily. Create a pbix or xlsx that contains sample data but still reflects your data model (tables, relationships, calculated columns, and measures). Upload the pbix to OneDrive, Google Drive, or Dropbox and share the link.

     

    Regards,

    Tom