We are given the equation:
\[
3^x = 9^{x-1}
\]
Now, \( 9 \) can be rewritten as \( 3^2 \), so the equation becomes:
\[
3^x = (3^2)^{x-1}
\]
Using the rule \( (a^m)^n = a^{mn} \), we can simplify the equation:
\[
3^x = 3^{2(x-1)}
\]
Since the bases are the same, we can set the exponents equal to each other:
\[
x = 2(x - 1)
\]
Now, solve for \( x \):
\[
x = 2x - 2
\]
\[
x - 2x = -2
\]
\[
-x = -2
\]
\[
x = 2
\]
Thus, the value of \( x \) is 2.