The Yadavas, i.e.: Sri Krishna, and the Kurus belong to the Chandravamsha just as Srirama belongs to the Suryavamsha. The origin of both vamshas trace back to the same root and then split away.
The Bhagavath Purana and the Mahabharata have slightly different lineages. The Bhagavath purana has a very unique story as follows.
The origin is with Brahmadeva, as expected.
Brahma →Marichi → Kashyapa→ Vivaswaan (Surya)→Shraddadeva, who is the 1st Manu or Vaivaswatha Manu→who had 10 sons, eldest being Ikshavaaku. In Ikshvaaku’s line comes Dasaratha and then the four brothers, eldest being Srirama.
This Shraddadeva had another offspring even before Ikshvaaku. He performed a yaga for a powerful son but his wife, Shradda devi, secretly wished for a daughter so she approached the priest who was performing the Yaga with her desire. When the priest poured the final oblations, he asked for a daughter instead of a son and so, much to Shraddadeva’s surprise, a daugther, Ila, was born.
Shraddadeva was puzzled and he asked Vasistha muni how this had happened. With his divine sight, the sage knew and he explained. He also agreed to make the daughter Ila a son, who was named Sudyumna.
Years passed and Prince Sudyumna grew up strong and brave. One day he went out hunting with his men. After a long chase, they entered a hidden grove in the Meru forest. The minute they crossed an invisible boundary, the prince and all his men transformed into women! In fact, even their war horses had turned into mares! The grove was the private space of Shiva and Parvati. Once Parvati had been terribly upset when some sages came upon the divine couple without warning. She had had to cover up her unclothed self hurriedly. Seeing her quite upset, Shiva declared that no man would enter the grove and any who did would turn into a woman immediately.
Now the prince Sudyumna had been turned into a woman along with his men. He was both shocked and puzzled. How could he go back home and tell people that their prince had gone away only to return as a gorgeous princess? He himself had no clue how this had happened.
The prince and the men stayed back near the grove unable to go back home, trying to figure out what was happening. While they lived there, one day, Budha, the son of the Moon god, Chandra, came down to Earth as he was wont to do. He saw the beautiful princess, now again named Ila, who had wandered into his ashrama and he fell in love. Ila too fell for the radiant Budha. The two soon had a son named Pururava. This Prururava was the first of the Chandravamsha lineage and his progeny carried forward this vamsha from there on.
Ila and Budha were happy for a few long years but then the princess Ila began to think about the kingdom they had all left behind, the princely life and also the princely duties. She approached Vasishta for a solution and the sage again stepped in with a solution- Ila would be a woman for a month and a man for the next!
Happy with the compromise, Ila/ Sudyumna went back to the kingdom and soon took over the reins from the king. The people were not happy at first with this strange situation where their king would become a queen every other month. But Sudyumna/ Ila proved to be such a great ruler that they soon ignored his/ her gender and accepted him whole heartedly.
Pururava’s descendents are as follows:
Pururava→ Aayu → Nahusha → Yayati, who exchanged his old age with his youngest son, Puru.
From Puru come the Pandavas. From Yayati’s eldest son, Yadu, come the Yadavas.
So beautiful, our culture and tradition is so much advanced that gender didn’t matter Bravo!