Forum Discussion
Tabular Editor: Non-Standard Calendar time comparisons/Conditional calculation with filters
The error now says Error on L13Wk Expression: The end of the expression was reached.
Try this:
VAR CurrWMWK =
SELECTEDVALUE( 'Calendar'[WM Chronological Order])
RETURN
IF(
ISSELECTEDMEASURE([OH Qty], [OH Cost], [POS Qty]),
CALCULATE(
DIVIDE( SELECTEDMEASURE(), COUNTROWS('Calendar')), --or the calendar table you need
FILTER(
ALL('Calendar'),
'Calendar'[WM Chronological Order] <= CurrWMWK - 1
&& 'Calendar'[WM Chronological Order] > CurrWMWK - 14
)
)
)
- Dichilyn13 years agoFrequent Visitor
It accepted the DAX, but the output doesn't seem to be reacting to the if statement and the values are not as expected
- julioverdugo3 years agoFrequent Visitor
You may need to adjust the filters for your period definition.
Can you provide a screenshot of your calendar table to understand the mechanic behind it and explain in more detail what is the expected output from the calculation?
- Dichilyn13 years agoFrequent Visitor
It is not an issue with the calendar or time portion, as the formula stemmed from a summation of the L13wks (which I validated before adding to the dax to apply the conditional filter).