Portia was not a judge, neither in "real life" in the play nor in the masquerade in Act IV in which she pretends to be Balthasar -- a young lawyer sent to defend Antonio is his suit against Shylock. The Duke is the judge in the courtroom scene.

The reason that Shylock calls Portia/Balthasar a "Daniel" is because the biblical Daniel was a judge of renowned wisdom. Shylock has no idea what he is saying and one of the most delightful ironies of the play is just how "Daniel" Portia turns out to be.

When the biblical Daniel judges Susanna (in the Old Testament Apocryphal book), he not only finds her not guilty of adultry but finds her accusers guilty of conniving to kill an innocent woman. In a similar reversal, Portia not only sees to it that Antonio is delivered from his legal predicament but convicts Shylock of attempted murder. Little did Shylock know, when he praised Portia/Balthasar for Danielic wisdom how parallel the two stories would be.