Ok, so your DATA table has a Ref column to the PROJECTS table. And since Project ID is the key in PROJECTS, the DATA table will store that Project ID.
To rephrase this, you want your Virtual Column named “countif trial for projects” to show the count of the number of unique Blocs that have the same TEXT in the column [Project] of the PROJECTS table based on the Project ID selected in the DATA table? Do I now have that correct?
If so that expression would be:
[PROJECT] = ANY(SELECT(PROJECTS[PROJECT],
[PROJECT_ID] = [_THISROW].[PROJECT]
The second SELECT() is there only to retrieve the name of the project so… you could simplify this by adding a [PROJECT NAME] column to your DATA table and assign it
Then the expression above could be written as:
[PROJECT] = [_THISROW].[PROJECT NAME], true
CAUTION: Because your input for the project name in PROJECTS is TEXT and not selected by a dropdown, you will likely get instances where the typed in project name is misspelled or entered with a slightly different spelling. This will throw off your numbers. I would use a dropdown to select these names.