Forum Discussion
Problem with 'PLACEHOLDER' in filteredData and Multiple values error in the calendar table
- Anonymous1 year ago
Hi Anonymous
Question 1:
Just as the CALENDAR() function said that the paramenters should be the single value
But the DATEADD() function returns a table(mutipal values), so these two function can not be used nested.
Here I did some change on your measures:
SelectedDate = MAX(Calendar[Date])DateThreshold = DATE(YEAR([SelectedDate]) - 5, MONTH([SelectedDate]), DAY([SelectedDate]))The DateThreshold returns:
Then add a measure:
Stand_5Y = VAR _DateThreshold = [DateThreshold] RETURN CALCULATE ( COUNT ( 'CecLeadingCase'[CecCaseId] ), FILTER ( 'Calendar', 'Calendar'[Date] <= _DateThreshold ) )The result is as follow:
Question 2:
If you just want to filter the data, you can just change the dax of calculated table as:
FilteredData = FILTER ( CecCaseDetail, CecCaseDetail[DefinitiveJudgmentDate] <= [DateThreshold] && CecCaseEvent[FromStateOfProceedingID] = 3 && CecCaseEvent[ToStateOfProceedingID] = 3 )But it's worth noting that the it will returns this error:
This is caused of your relationship(the cross-filter direction is single and the direction is from CecCaseDetail to CecCaseEvent so that you can not use fields in CecCaseEvent to filter CecCaseDetail):
You can change the direction into both(it has some limitations) or filter the table manually, here's a link for your reference:
Create and manage relationships in Power BI Desktop - Power BI | Microsoft Learn
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - Anonymous1 year ago
Ok this problem was solved if you get this error, check again relationships between tables
It fit in calendar and no error but criteria doesnt work. It doesnt show historic data e.g user pick 11/10/2024 and it should show data from 11/10/19 and older. Can you check it with my pbix files?
Hi Anonymous
Question 1:
Just as the CALENDAR() function said that the paramenters should be the single value
But the DATEADD() function returns a table(mutipal values), so these two function can not be used nested.
Here I did some change on your measures:
SelectedDate = MAX(Calendar[Date])DateThreshold = DATE(YEAR([SelectedDate]) - 5, MONTH([SelectedDate]), DAY([SelectedDate]))
The DateThreshold returns:
Then add a measure:
Stand_5Y =
VAR _DateThreshold = [DateThreshold]
RETURN
CALCULATE (
COUNT ( 'CecLeadingCase'[CecCaseId] ),
FILTER ( 'Calendar', 'Calendar'[Date] <= _DateThreshold )
)
The result is as follow:
Question 2:
If you just want to filter the data, you can just change the dax of calculated table as:
FilteredData =
FILTER (
CecCaseDetail,
CecCaseDetail[DefinitiveJudgmentDate] <= [DateThreshold]
&& CecCaseEvent[FromStateOfProceedingID] = 3
&& CecCaseEvent[ToStateOfProceedingID] = 3
)
But it's worth noting that the it will returns this error:
This is caused of your relationship(the cross-filter direction is single and the direction is from CecCaseDetail to CecCaseEvent so that you can not use fields in CecCaseEvent to filter CecCaseDetail):
You can change the direction into both(it has some limitations) or filter the table manually, here's a link for your reference:
Create and manage relationships in Power BI Desktop - Power BI | Microsoft Learn
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous1 year agoNot applicable
Hello, Thank you for solution but still getting this error you mentioned above. I changed relationship between tables to "Both" and still "filteredData" doesnt work. Where do you could be the problem?
or this similar error
- Anonymous1 year agoNot applicable
I get this error as well
- Anonymous1 year agoNot applicable
Ok this problem was solved if you get this error, check again relationships between tables