Forum Discussion
Tabular Editor: Non-Standard Calendar time comparisons/Conditional calculation with filters
Based on your screenshot, you need to replace the SELECTEDMEASURE() right after the CALCULATE statement with the DIVIDE statement below.
Let me know if this solves the issue.
Best,
JV.
- Dichilyn13 years agoFrequent Visitor
The error now says Error on L13Wk Expression: The end of the expression was reached.
- julioverdugo3 years agoFrequent Visitor
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