Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago

YTD - Quick Measure for YOY

Hi all,

 

I am trying to create this report for my sales team:

 

 

Customer2015 YTD Sales2016 YTD Sales
ABC1000011000
DEF2000022000
XYZ3000033000

 

 

I am using this a quick measure with this DAX:

 

OrderTotal YTD =
IF(
 ISFILTERED('DateDim'[DIMDATE]),
 ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy."),
 TOTALYTD(SUM('OrderHeaderDim'[OrderTotal]), 'DateDim'[DIMDATE].[Date])
)

 

I recieve this result:

 

 

 

 

 

 

I would expect not to see November and December for 2016. I have also tried writing my own DAX but get the same result. 

 

Thank you in 

 

 

3 Replies

  • Hi,

     

    Try this

     

    =IF(ISBLANK(SUM('OrderHeaderDim'[OrderTotal])),BLANK(),IF(
     ISFILTERED('DateDim'[DIMDATE]),
     ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy."),
     TOTALYTD(SUM('OrderHeaderDim'[OrderTotal]), 'DateDim'[DIMDATE].[Date])
    ))

    Hope this helps.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for your reply! Sorry didn't work. Here is the result:

       

       

      As you can see October, November and December are showing for 2016.