There are 2 methods for calculating the mass distribution using only "visible mass". One inaccurate way is to count the stars themselves by closely counting visible stars, dust, and gas as determined by infrared observations in a convenient representative area of a galaxy, and extrapolating that result to the rest of the comparable areas of a galaxy. The other far more accurate and widely used method is to calculate the mass distribution by using the rotation curve. We calculate the mass inside a series of concentric rings and subtract the mass obtained from the calculation for the mass enclosed inside the inner rings from the mass calculated enclosed inside the outer rings. This give a mass value for a specific ring. Divide this ring mass by its area i.e. area inside of outer circle of the ring minus area of inner circle of the ring gives area of ring. Divide the mass calculated for the ring by the area of the ring gives the mass per unit area (mpua) of the ring. We can then graph the mpua of the outer rings to the mass per unit area of the inner rings. What we find using this method is an mpua that is closely consistent with a disk distribution. For example when we drill a hole of a specific size in a record album near the edge (equator) and another the same size near the center (pole) we find the mass from the holes to be equal. That shows the mass from the holes per unit area of the holes to be consistent with coming from a disk. In the bulge or spherical galaxy the mpua from the equator to the pole increases consistent with a bulge or sphere.
The mpua derived from the star, dust, gas counting method, while consistent with a disk distribution, is vastly lower than the mpua derived from rotation curves. We recognize this to mean that there is a vast amount of non stellar, non dust, and non gas mass in galaxies. Some call this mass dark matter. But dark matter just means unseen with no other assumed attributes. Some give it attributes not supported by any observation, and which are inconsistent with observation, such as saying it's non baryonic (not normal matter). Non baryonic matter models are inconsistent with the disk shape because there are no interaction attributes of non baryonic matter that allow for accretion to a disk. There are non baryonic models with ad hoc assumption of weakly interacting attributes. But none fit the observed disk distribution as well as fully interacting normal baryonic matter.
Some pursue a modification of Newtonian dynamics (mond) as an explanation. But they are fringe ideas and not supportable mathematically, or by physics.
The question remains, what is the unseen matter if not stars, dust, gas, or non baryonic? A conservative assumption would be that it is composed of compact sub stellar objects. Sub stellar objects include gas giant planets, terrestrial planets, asteroids, Kyper belt, and Ort cloud objects. There is a problem with nomenclature however. Recalling the Pluto nomenclature squabble. What is an object not orbiting a star? A rogue planet? What if they are super Jovians with terrestrial satellites? What about rogue asteroids? What about rogue terrestrials?