Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Calculating HHI (Hirschmann Herfindahl Index)

I would like to be able to calculate the HHI (Hirschmann Herfindal Index)

 

The goal is to have a table where each row is for one industry.  I then want the HHI for that industry which would be calculated by calculating the market share of each company and then squaring each market share.  I would then need to add up all the results of the market shares squared for each company to get the HHI for the industry.  

 

I would like guidance on how to calculate these formulas as the company names will not be showing in the industry table.

 

Thank You!

7 REPLIES 7
richbenmintz
Solution Sage
Solution Sage

Hi @Anonymous,

 

Any chance you could provide some sample data and the expected outcome?

 

Thanks,

Richard



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


Anonymous
Not applicable

@richbenmintz - I can't upload my data due to compliance reasons.  Goal outcome is:

 

IndustryHHI
Manufacturing

.8

Technology.2
Energy.5

 

There are many companies that have to have their market share squared within each of the industries 

Hi @Anonymous,

 

so to "kiss" this request I would create a calculated column to calc the the squared market share for each company like 

 

Squared Market Share = POWER([market_share]), 2)

 

Then you just need to create a measure HHI

 

HHI = sum('table'[Squared Market Share])

 

 

Hope that helps,

Richard 


Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


Anonymous
Not applicable

@richbenmintz  - really appreciate your help here!

 

Here is what I have so far:

 

Market Share:  numerator = sum('table[revenue])

                   denominator = calculate([numerator], ALLSELECTED (table))

                   market share calculation = DIVIDE([numerator],[denominator])

 

HHI:  Step 1: Power([market share calculation],2)

         Step 2: This is the formula that is not working properly for me.  I am attempting =sum(table[HHI Step 1])

                  - HHI step 1 does not appear as an option after inputting the table name for my data input.

 

Please advise if all my formulas are correct and how to solve HHI step 2 issue - thank you!

@Anonymous,

 

I created some mock data

industry company revenue

industry 1company 11000
industry 1company 22000
industry 1company 33000
industry 1company 44000
industry 2company 52000
industry 2company 63000
industry 2company 77000
industry 2company 810000

and came up with the following

Market Share HHI = 
    var rev = sum(HHI[revenue])
    var totalIndustryRev = CALCULATE(sum(HHI[revenue]), ALL('HHI'[company]))
return if(HASONEVALUE('HHI'[industry]), power(divide(rev, totalIndustryRev), 2))

 

HHI Val = if(HASONEVALUE(HHI[industry]), SUMX(VALUES(HHI[company]), [Market Share HHI]) )

 

I hope this helps,

Richard


Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


Anonymous
Not applicable

@richbenmintz - thank you very much for taking the time to write that out for me!  

 

Your formula includes:

(HASONEVALUE('HHI'[industry])

 

Is there a way to make this formula more dynamic to not include [industry] in both formulas?  For example: I may occassionally change the first column in the table from industry and make it product.  Would be nice to not have to edit the formula each time/have two HHI formulas and swap the other in. 

 

Thank You 

Hi @Anonymous ,

 

I think you could generalize it a little more with the following

Market Share HHI = 
    var rev = sum(HHI[revenue])
    var totalIndustryRev = CALCULATE(sum(HHI[revenue]), ALL('HHI'[company]))
    var totalProductRev = CALCULATE(sum(HHI[revenue]), ALL('HHI'))
return 
    SWITCH(TRUE(), 
        HASONEVALUE('HHI'[Product]), power(divide(rev, totalProductRev),2),
        HASONEVALUE('HHI'[industry]), power(divide(rev, totalIndustryRev),2)
    )

HHI Val = 
      SWITCH(TRUE(), 
       HASONEVALUE(HHI[Product]), SUMX(HHI, [Market Share HHI]),
        HASONEVALUE(HHI[industry]), SUMX(VALUES(HHI[company]), [Market Share HHI]) 
    )

 

Hope this helps,

Richard


Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.