How to do it...

To implement this recipe, perform the following steps:

  1. Create the following column in the R10_Table table:
IsPrime = 
VAR __num = 'R10_Table'[Value]
VAR __max = INT(SQRT(__num))
VAR __table = GENERATESERIES(2 , __max , 1)
VAR __table1 = ADDCOLUMNS(__table,"__mod",MOD(__num , [Value]))
RETURN
SWITCH(
TRUE(),
__num = 1, FALSE(),
ISBLANK(COUNTROWS(FILTER(__table1,[__mod] = 0))),TRUE(),
FALSE()
)