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.
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
- 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?