Forum Discussion

MojoGene's avatar
MojoGene
Post Patron
9 years ago
Solved

SAMERPERIODLASTYEAR - Non Contiguous Date Selection Error

I've read multiple posts on this error: "SAMEPERIODLASTYEAR expects a contiguous selection when the date column comes from a table on the 1-side of a bidirectional relationship." I am still baffled by my error.

 

I have a simple measure for calculating fees billed:

Fees Billed = CALCULATE(SUM(FactTable[AmtBilledForSubtype]),FactTable[BillSubtype]="FEE")

I have another measure for YTD Fees:

Fees Billed YTD = TOTALYTD([Fees Billed],Table_BasicCalendarUS[DateKey])

No problems with either of these measures.

 

Now I want Fees Billed for the same period last year. Here is the troublesome measure:

Fees Billed SPLY = CALCULATE([Fees Billed YTD],SAMEPERIODLASTYEAR(Table_BasicCalendarUS[DateKey]))

 

The error message suggests that there is a bi-directional relationship at the heart of the problem, but 

in my date table, the DateKey column has a one-to-many, single cross-filter relationship to the DateBilled colum in the FactTable.

 

Any suggestions?

16 Replies

  • bblais's avatar
    bblais
    Resolver III

    Just curious, is your Table_BasicCalendarUS[DateKey]) of type date or something else?