Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

YOY Quick Measure

Hi I have used the followimg quick YOY measure. All works well. However, for my current year I dont have data for all the months yet. My report now shows a 100% YoY negative growth. How do I fix this to not show this?

 

Sales_Retail YoY% =
IF(
    ISFILTERED('BI_Category'[Period_From_Date]);
    ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column.");
    VAR __PREV_YEAR =
        CALCULATE(
            SUM('BI_Category'[Sales_Retail]);
            DATEADD('BI_Category'[Period_From_Date].[Date]; -1; YEAR)
        )
    RETURN
        DIVIDE(SUM('BI_Category'[Sales_Retail]) - __PREV_YEAR; __PREV_YEAR)
)
 
Any help please.
  • Hi. I usually don't recommend quick measures because you don't write the idea you want. Anyway, I think this might be because AutoDateTime time intelligense option in power bi will create a table which the last date is 31/12/ActualYear. I'm talking about this: 'BI_Category'[Period_From_Date].[Date]

    If you create your own Calendar Date Table you can control it to have data untill today. Relate it to your table and use the Date Column of the calendar table in that formula. You can check how to create a table like this in here.

     

    Regards,

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • Hi. I usually don't recommend quick measures because you don't write the idea you want. Anyway, I think this might be because AutoDateTime time intelligense option in power bi will create a table which the last date is 31/12/ActualYear. I'm talking about this: 'BI_Category'[Period_From_Date].[Date]

    If you create your own Calendar Date Table you can control it to have data untill today. Relate it to your table and use the Date Column of the calendar table in that formula. You can check how to create a table like this in here.

     

    Regards,

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.