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
anettbaksa
Frequent Visitor

Market share in hierarchy

Hello, 

 

I have a thousand product in hierarchy something like this: 

 

Category
Subcategory
Manufacturer
Brand 
Subbrand
Product 

I would like to calculate market share (%) what based always on the Subcategory, so subcategory is the 100% in all level. For example the product market share has to be the proportionate % of the Subcategory. Subbrand, Brand and Manufacturer is the same situation like product. After I have to show this market shares in matrix. The rows contains the product hierarchy and the only column contains the market share in %. 

 

Can anybody help me with the calculation? 

 

Thank you, 

Anett 

1 ACCEPTED SOLUTION

HI  @anettbaksa 

You could try the formula as below:

Measure = 
DIVIDE (
    CALCULATE ( SUM ( 'Table'[Value in millio HUF] ) ),
    CALCULATE (
        SUM ( 'Table'[Value in millio HUF] ),
        ALLEXCEPT ( 'Table', 'Table'[subcategory] )
    ),
    0
)

or

Measure 2 = 
DIVIDE (
    CALCULATE ( SUM ( 'Table'[Value in millio HUF] ) ),
    CALCULATE (
        SUM ( 'Table'[Value in millio HUF] ),
        FILTER(ALLSELECTED('Table'),'Table'[subcategory]=MAX('Table'[subcategory]))
    ),
    0
)

 

and here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hi  @anettbaksa 

Sample data and expected output would help tremendously.
Please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-lili6-msft 

I made sample data. The dataset is the following:

trial.PNG

 

 

 

 

 

 

 

 

 

And I have to show it in matrix like that:

trial 2.PNG

The subcategories have to be always the 100%. For example look the "Tablets" subcategory.  A and B brand create the 100% of tablets market share. That's usual market share calculation. But after this level the logic is change. Brand1 and Brand2 is also create the 100% of tablets market share. Brand 1- dark, Brand 1- milk, Brand 1- white and Brand 2 (this is not brand, but subbrand level because this product don't have subbrand level, in this case we use the brand name again or empty) is also create the 100% of tablets. And product level is also the same. 

 

I hope this is understandable. If it's not, please ask. 

 

Thank you, 

Anett 

 

HI  @anettbaksa 

You could try the formula as below:

Measure = 
DIVIDE (
    CALCULATE ( SUM ( 'Table'[Value in millio HUF] ) ),
    CALCULATE (
        SUM ( 'Table'[Value in millio HUF] ),
        ALLEXCEPT ( 'Table', 'Table'[subcategory] )
    ),
    0
)

or

Measure 2 = 
DIVIDE (
    CALCULATE ( SUM ( 'Table'[Value in millio HUF] ) ),
    CALCULATE (
        SUM ( 'Table'[Value in millio HUF] ),
        FILTER(ALLSELECTED('Table'),'Table'[subcategory]=MAX('Table'[subcategory]))
    ),
    0
)

 

and here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-lili6-msft , 

 

Thank you for the answer, it's working. 

Just one more question. 

 

If i want to show this market share for every month, how can I do it?

Because if I put the period in columns, it's not working. It split 100% for months. 

 

Thank you, 

Anett 

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.

Top Solution Authors
Top Kudoed Authors