When was the NBA formed by a league merger?
1949 AD
The National Basketball Association was formed under that name in 1949, when the Basketball Association of America and National Basketball League merged. The agreement brought together teams from two competing professional organizations. It is the merger, rather than the first professional basketball competition of any kind, that the question asks you to date.
The NBA also traces its official history to the BAA's founding in 1946. This explains why both 1946 and 1949 appear in descriptions of the league's beginnings. The earlier date follows the institutional history the NBA adopted; the later one identifies the combination with the NBL and the emergence of the NBA name. They describe different aspects of continuity and reorganization.
A further merger involving the American Basketball Association occurred in 1976 and brought four ABA franchises into the NBA. That is another major change, but it involved a different rival league decades later. Keeping the initials attached to each event avoids confusion: BAA and NBL belong to 1949, while the later ABA agreement belongs to 1976.