Forum Discussion
Total Projects for Fiscal
- Anonymous2 years ago
Hi Jhadur ,
It looks like there is an error in your DAX code that is preventing the data from being loaded. The error message states that the text value “BNSPRJOP230245” could not be converted to a True/False type. This is usually because the text value is used in a logical expression.
So I think you can just calculate the value returned by _Table. Here is my modified DAX code:
TOTAL PROJECTS FOR FY = VAR __MinDate = DATE ( 2023, 11, 01 ) VAR __MaxDate = DATE ( 2024, 10, 31 ) VAR __Table = FILTER ( 'Projects', [Start] >= __MinDate && 'Projects'[Start] <= __MaxDate ) RETURN COUNTROWS ( __Table )Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Jhadur ,
I agree with what Idrissshatila said. So I create a table as you mentioned.
The reason for your error comes from the fact that __Result is not defined. You can output to variables in your VAR, which means that if you want to use __Result, you need to define the variable in a VAR to guarantee output.
Also I noticed that the following string of DAX code also has an error.
VAR __CALCULATE = (COUNTROWS('Projects'),FILTER('Projects','Projects'[Project Code])
I modified it and the final DAX code is as follows:
TOTAL PROJECTS FOR FY =
VAR __MinDate =
DATE ( 2023, 11, 01 )
VAR __MaxDate =
DATE ( 2024, 10, 31 )
VAR __Table =
FILTER ( 'Projects', [Start] >= __MinDate && 'Projects'[Start] <= __MaxDate )
VAR __CALCULATE =
COUNTROWS ( FILTER ( 'Projects', 'Projects'[Project Code] ) )
RETURN
__CALCULATE + 0
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Jhadur2 years agoHelper I
Thank you Anonymous that fixed the measure. However I am now getting this error in the card visualization.
- Anonymous2 years agoNot applicable
Hi Jhadur ,
It looks like there is an error in your DAX code that is preventing the data from being loaded. The error message states that the text value “BNSPRJOP230245” could not be converted to a True/False type. This is usually because the text value is used in a logical expression.
So I think you can just calculate the value returned by _Table. Here is my modified DAX code:
TOTAL PROJECTS FOR FY = VAR __MinDate = DATE ( 2023, 11, 01 ) VAR __MaxDate = DATE ( 2024, 10, 31 ) VAR __Table = FILTER ( 'Projects', [Start] >= __MinDate && 'Projects'[Start] <= __MaxDate ) RETURN COUNTROWS ( __Table )Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Jhadur2 years agoHelper IThank you. This works perfectly. Appreciate the assistance.