Forum Discussion
Remove partial filter
Thanks. Tried but getting the following error.
Hi, Thulasiram
The error indicates that there is a type mismatch between the SelectedMonth and Date[MonthNumber] values. To fix this, we should ensure both values are of the same type. If one is a text and the other is an integer, we can use the VALUE function to convert the text to a number or the FORMAT function to convert the number to text.
Here's the updated DAX measure:
SalesUpToSelectedMonth =
VAR SelectedMonth = VALUE(MAX('Date'[Month])) -- Ensure month is treated as a number
VAR SelectedYear = MAX('Date'[Fiscal Year])
RETURN
CALCULATE(
SUM('Sales'[SalesAmount]),
FILTER(
ALL('Date'),
'Date'[Fiscal Year] <= SelectedYear &&
(
'Date'[Fiscal Year] < SelectedYear ||
VALUE('Date'[MonthNumber]) <= SelectedMonth
)
)
)
If this post helps, then please consider Accept it as the solution and kudos to this post to help the other members find it more quickly
- Thulasiram2 years agoHelper II
Many thanks for reply.
Before proceeding further i would like to explain further about my tabble.
Month is in MMM-YY format - text. (example - "Mar-24")
Fiscal year is YYYY-YY - text ("2024-25")
Month no - numbers - number - (3)Can I still use the above code or it needs any amendment. Many thanks.