The triple clean sweep in all 3 formats of cricket has been recorded once before, when Pakistan visited Australia in 2009-10. Australia won the Tests 3-0, the ODIs 5-0 and the single T20I (admittedly by only 2 runs). You can see the details here:
The second Test was won by the comparatively narrow margin of 36 runs.
Then came the ODIs:
The first 4 ODIs were rather one-sided although Australia won the 5th one by 2 wickets.
Australia won the by just 2 runs, making it a 9-0 sweep. Remember that this was in their home country.
Nothing like this was achieved until India visited Sri Lanka in 2017:
Tests 3-0 with Sri Lanka losing by big margins:
ODIs 5-0, all by handsome margins except one win by 3 wickets:
And the T20I by a good margin:
Thus India emulated Australia’s 9-0 triple clean sweep, with somewhat bigger margins of victory. But unlike Australia, they achieved this away from home.
Salute Virat Kohli and his men.
Kohli captained all 9 matches, but faced a bewildering array of captains:
Tests: Herath, Chandimal, Chandinal
ODIs: Tharanga, Tharanga, Kapugedara, Malinga, Tharanga
In contrast, the Australian captain Ponting faced M. Yousuf in the three Tests and 4 of the 5 ODIs, when Afridi came in for the last one. In the T20I it was Clarke vs Shoaib Malik.
Earlier, India won a T20I series 3-0 in Australia in early 2016 which was believed to be the only clean sweep by a visiting team in Australia in any format of cricket in a series of at least 3 matches: