Forum Discussion

Draginko's avatar
Draginko
Icon for Helper I rankHelper I
3 years ago
Solved

How to overcome error "Function 'DATEADD' expects a contiguous selection..." with bi-dir date table

I have dashboard with different views on email traffic analytics, where I have one visual displaying evolution of reads for first week, and in order to make it work I have a bi-directional relationsh...
  • Draginko's avatar
    Draginko
    3 years ago

    Thank you for your message NikhilChenna .

    However, in my case, due to the narrow timeframe of dataset, currently I have data only for this year, and in every situation I want to compare two following quarters, so they are indeed contiguous. 

    And also, based on this logic this should break both quarter names and numeric calculations.

     

    In the meantime I found one, not very elegant tho, solution, which after initial testing seems working fine.

    I have replaced the previously used measure for giving previous of the selected quarter:

    PreviousQrt =
    CALCULATE(
        (fct_SendMessages[SelectedQrt]),
        DATEADD('Calendar'[Date], -1, QUARTER)
        )
     
    And replaced with this measure:
    PreviousQrt_viaMax =
    CALCULATE(
        MAX('Calendar'[Quarter])
    ) -1

    As I have mentioned, not very elegant, but it seems it is doing the required job, so far all is good. I think we can close this thread.
     
    Thank you