Make sure there is an active, single direction relationship between the date column in your calendar table and the order date column in the Orders table. You will also need a couple of measures. Note, to use the measures below, your calendar table must also contain a column named Year Month Number. You can add this as a calculated column if needed.
Measure 1: # orders for the current month
# Orders:= distinctcount ( Orders[ORDER_ID] )
Measure 2: # orders for the prior month
# Orders PM :=
VAR CurrentYearMonthNumber = SELECTEDVALUE ( 'Calendar'[Year Month Number] )
VAR PreviousYearMonthNumber = CurrentYearMonthNumber - 1
VAR Result =
REMOVEFILTERS ( 'Calendar' ),
'Calendar'[Year Month Number] = PreviousYearMonthNumber
YearMonthNumber - if the date is 11/30/2022, the value of this field would be 220211. It is important to think about the year in conjunction with the month so that you can maintain continuity across years. For example, the difference between December and January. Without the year being specified, the counts for December for all years would be retuned and compared against the counts for January across all years.
The same column from the calendar table should be used in the CurrentYearMonthNumber variable and the Result variable. In your script you are referencing two different columns.
The relationship between Orders and Calendar should be single direction; yours is bidirectional. While there are some valid use cases for bidirectional relationships, when possible, model the data so that single direction relationships are used in order to avoid data ambiguity and inefficient models.