Forum Discussion
Anonymous
6 years agoNot applicable
Using Randbetween for a column level condition
I want to assign random values between 1 to 30 for a particular category "C" alone,means all other categories will have a value of 0.
How can I achieve this?
randnum = if('Y[Categ]="C",rand(),0),this is my current calculated column,I have values between 0 and 1 returning,but I want values between 1 & 30 returning when the Categ is "C".
What error message are you getting?
Otherwise if Randbetween is not working you could use something like
Column = IF('Table'[Categ] = "C",RAND()*(30-1)+1,0)
3 Replies
- GordonliljSolution Sage
Hi,
Is this what you're after?
Column = IF('Table'[Categ] = "C",RANDBETWEEN(1,30),0)- AnonymousNot applicable
I tried doing that but getting an error.Thanks for responding.
- GordonliljSolution Sage
What error message are you getting?
Otherwise if Randbetween is not working you could use something like
Column = IF('Table'[Categ] = "C",RAND()*(30-1)+1,0)