Forum Discussion
Last 5 weeks
The error message "A table of multiple values was supplied where a single value was expected" typically occurs when a DAX expression is expecting a single value, but it receives a table or multiple values instead.
In your case, the error is likely caused by the fact that the `ID[CountCRQ]` column is returning a table or multiple values within the `CALCULATE` function. To resolve this, you can modify your DAX expression to ensure that a single value is returned.
Here's an updated version of your measure:
```DAX
Last 5 Week Today =
VAR _min1 = TODAY() - WEEKDAY(TODAY(), 1) - 7 // Sunday week start
VAR _max = _min1 + 6
VAR _min = _min1 - 4 * 7
RETURN
CALCULATE(
COUNT(ID[CountCRQ]),
FILTER(
ALL(ID),
ID[Submit Date] >= _min && ID[Submit Date] <= _max
)
)
```
In the above expression, I changed `ID[CountCRQ]` to `COUNT(ID[CountCRQ])` within the `CALCULATE` function. This ensures that a single value is returned, which represents the count of `ID[CountCRQ]` within the specified date range.
Additionally, I used the `ALL` function to remove any existing filters on the `ID` table. This allows the calculation to consider all rows within the date range specified by `_min` and `_max`.
Make sure to replace `ID[Submit Date]` with the actual column reference for the submission date in your table.
I hope this helps! Let me know if you have any further questions.