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
Strato
New Member

Herfindahl-Hirschman index

Morning

 

Hope somebody might be able to help me with this.

 

I'm trying to dynamically calculate the HHI for some data, which will vary depending on the values selected in slicers.  

 

I've got about 40k rows of data, one for each product.  Each product has 6 descriptors and I need a slicer for each descriptor.  A smaller example of this is given in the table below.  

 

CompanyProduct CategoryColourSizeSales Volume
A1GreenLittle30
A2BlueBig130
A14RedMedium10
A53YellowLittle280
B21PuceBig121
B16GreenMedium178
B5GreenLittle150
C33BlueBig25
C14RedMedium0
C17YellowLittle15
D41PuceBig25
D25GreenMedium10
D24GreenLittle5
D5BlueBig5
E21RedMedium25
E37YellowLittle10
etc    

 

I can easily get the report to dynamically calculate shares of sales depending on the slicer selections, and HHI is the sum of the squares of these shares, so I can do the first part of the calculation also.  I have a measure that calculates "Share" and another for "HHI Calc".  

 

CompanySales VolumeShareHHI Calc
A45044.2%19.5%
B44944.1%19.4%
C403.9%0.2%
D454.4%0.2%
E353.4%0.1%

 

The HHI Calc dynamically calculates ((Sales / Total Sales) * (Sales / Total Sales)).

 

What I want to be able to do is display a card that shows the Sum of HHI Calc - in this example 39.4%.  

 

Anybody have any ideas?

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

Hi @Strato

 

Try this MEASURE

 

Measure =
SUMX ( ALLSELECTED ( Table1[Company] ), [HHI Calc] )

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

Hi @Strato

 

Try this MEASURE

 

Measure =
SUMX ( ALLSELECTED ( Table1[Company] ), [HHI Calc] )

Regards
Zubair

Please try my custom visuals

Works a treat and nice and simple.  Thanks 🙂

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.