If Brahman as per Advaitha was Nirguna, how can it assume forms and create everything ? How can something which is formless take forms and create all materials in universe ?
This question assumes that Nirguna Brahman and Saguna Brahman or Isvara are different. They are same.
Who is Ishvara? Janmadyasyayatah - "From whom is the birth, continuation, and dissolution of the universe," - He is Ishvara - "the Eternal, the Pure, the Ever-Free, the Almighty, the All-Knowing, the All-Merciful, the Teacher of all teachers"; and above all, Sa Ishvarahanirvachaniya-premasvarupah - "He the Lord is, of His own nature, inexpressible Love." These certainly are the definitions of a Personal God. Are there then two Gods - the "Not this, not this," the Sat-chit-ananda, the Existence-knowledge-Bliss of the philosopher, and this God of love of the Bhakta? No it is the same Sat-chit-ananda who is also the God of Love, the impersonal and personal in one. It has always to be understood that the Personal God worshipped by the Bhakta is not separate or different from Brahman. All is Brahman, the One without a second; only the Brahman, as unity or absolute, is too much of an abstraction to be loved and worshipped; so the Bhakta chooses the relative aspect of Brahman, that is Ishvara, the Supreme Ruler. To use a simile:Brahman is as the clay or substance out of which an infinite variety of articles are fashioned. As clay, they are all one; but form or manifestation differentiates them. Before everyone of them was made, they all existed potentially in the clay, and, of course, they are identical substantially; but when formed, and so long as the form remains, they are separate and different; the clay-mouse can never become a clay-elephant, because, as manifestations, form alone makes them what they are, though as unformed clay they are all one. Ishvara is the highest manifestation of the Absolute Reality, or in other words, the highest possible reading of the Absolute by the human mind. Creation is eternal and so also is Ishvara........Those who attain to that state where there is neither knower, nor knowable, nor knowledge, where there is neither I, nor thou, nor he, where there is neither subject, nor object, nor relation, "there, who is seen by whom?" - such persons have gone beyond everything to "where words cannot go nor mind", gone to where the Shrutis declare as "Not this, not this"; but for those who cannot, or will not reach this state, there will inevitably remain the triune vision of the one undifferentiated Brahman as nature, soul and the interpenetrating sustainer of both - Ishvara. ..... Bhakti, then, can be directed towards Brahman, only in His personal aspect. "The way is more difficult for those whose mind is attached to the absolute!" Bhakti has to float on smoothly with the current of our nature. True it is that we cannot have any idea of the Brahman which is not anthropomorphic, but is it not equally true of everything we know? The greatest psychologist the world has ever known, Bhagavan Kapila, demonstrated ages ago that human consciousness is one of the elements in the make-up of all the objects of our perception and conception, internal as well as external. Beginning with our bodies and going up to Ishvara, we may see that every object of our perception is this consciousness plus something else, whatever that may be; and this unavoidable mixture is what we ordinarily think of as reality. Indeed it is, and ever will be, all of the reality that is possible for human mind to know. Therefore, to say that Ishvara is unreal, because He is anthropomorphic is sheer nonsense. It sounds very much like the occidental squabble on idealism and realism, which fearful-looking quarrel has for its foundation a mere play on the word "real". The idea of Ishvara covers all the ground ever denoted and connoted by the word real, and Ishvara is as real as anything else in the universe; and after all, the word real means nothing more than what has now been pointed out. Such is our philosophical conception of Ishvara.
The Complete Works of Swami Vivekananda III.37-42
It is the Maya Sakti of Brahman who creates the universe. Brahman, when sakti is active, is called Ishvara or Saguna Brahman. Brahman is called Nirguna Brahman when Sakti is inactive. A man is called father when he has a child and is not called a father when he is childless.
A better analogy than given above would be the sun. The difference between the Nirguna Brahman and Saguna Brahman is that between the noon Sun and the evening Sun. The noon Sun is enormously bright and yellow while the evening Sun is less bright and red. In spite of this difference in appearance it is the same Sun that is being absorbed.
Why do Bhaktas say that Brahman is a Person and Jnanis say that Brahman is Impersonal? The answer is that Bhakti marga makes it possible for a Bhakta see Brahman in the realm of Sakti and hence Brahman appears as a Person. The method of Jnana marga takes a spiritual aspirant outside the domain of active Sakti and hence Brahman appears to be Impersonal. It is the same Brahman which appears to be different due to the two different methods.