I want to calculate the Herfindalh-Hirschmann Index (sum of market shares at square) by videogame publisher. In Power BI, i have 2 measures, the market share and the square of market share for each publisher. My calculations are good but the general total is false for the square of market share.
My DAX code is this for the Market Share (correct calculation & total) :
Market Share = VAR Volume = SUM('Sales - Global'[Sales]) VAR AllVolume = CALCULATE(SUM('Sales - Global'[Sales]), ALL('Publisher')) RETURN DIVIDE(Volume, AllVolume)
My DAX code is this for the Squared Market Share. I ant to conserve the (*100) to better interprete the result. Calculations are good but the general total is incorrect. :
Market Share Square = VAR Volume = SUM('Sales - Global'[Sales]) VAR AllVolume = CALCULATE(SUM('Sales - Global'[Sales]), ALL('Publisher'[Publisher])) VAR MarketShare = DIVIDE(Volume, AllVolume)*100 RETURN MarketShare * MarketShare