Forum Discussion

KristinaBakic's avatar
KristinaBakic
Frequent Visitor
10 years ago
Solved

Visualization breaks with DATEADD function and a slicer with non-consecutive dates

Hi!

 

I have a visualization that compares this year's data to last year's + I have a slicer to represent different months. It works fine while filtering on consecutive months, but if I filter based on non-consecutive months, the visualization breaks for the previous year's data. How can I prevent this from happening? 

 

I know, filtering based on non-consecutive months is not something users would generally do, but I just don't want the visualization to break, I'd rather it show Blank than "Could not show visualization"

 

Thanks!

4 Replies

  • konstantinos's avatar
    konstantinos
    Memorable Member

    Not sure if that will work ( in Pivot tables works ) depending the graph...You can try though.... wrap your measure with 

     

    Measure =  IF( HASONEVALUE( DateTable[Year]); Your Measure )) 

     

      • KristinaBakic's avatar
        KristinaBakic
        Frequent Visitor

        Thanks!

        I did know the "continous dates" restriction, but thought it mattered only in the context of a single function and didn't realize it applied to this case too. Still learning! 

         

        :)