We start by using SUMMARIZE to group our base data table, R01_Table, by the values in the Value column. To this table we add the Probability column, which simply divides the count of the grouped values by the count of all rows within the table. We then use ADDCOLUMNS to add an additional column to this table called H(X), which simply implements the equation for Shannon entropy. We then use SUMX to sum the H(X) column for all of the rows within the summarized table and return the result.
Because this recipe computes probabilities and thus uses COUNTROWS, the data within the base data table can be either numeric or text.