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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
deepalig
Frequent Visitor

TopN with other Share at brand level. Other values is not giving correct value.

Hi All,

I am trying to get top 10 brands with their share % and other should be give share % for rest of the brands.

I checked a few methods which helped me getting my top 10 share but other is giving 100 % which is not the right value.

DAX

1. I created a separate brand table with Other as new row as below.

TopBrands =
    UNION(
        VALUES('Table'[brand]),
        ROW("Brand","Other")
    )
          also created a column named Order using dax as 
          Order brands = if('Top Brands'[brand]="Other",2,1)

2. Created one to many relationship  between 'TopBrands' table and main table on brand
3. Created a rank measure         
Brand Ranking by share % =
 RANK(DENSE,ALL('Top Brands'),orderby('Top Brands'[Order brands],ASC,[Brand Share %],desc))

4.Brand Share % is calculated based on nested measure to give values based on different slicer selection,for example -YTD,MTD and on each selection the value should change
Brand Share % =
var Divisor = CALCULATE([NestedMeasure], ALLSELECTED('Top Brands'[brand]))
RETURN DIVIDE([NestedMeasure], Divisor, BLANK())

5. At last created 
Total with other =
if([Brand Ranking by share %] <= 10, [Brand Share %],
    if(HASONEVALUE('Top Brands'[brand]),
        if(values('Top Brands'[brand]) = "Other",
            sumX(filter(ALL('Top Brands'[brand]), [Brand Ranking by share %] > 10),  [Brand Share %])
        )
    )
This is giving me result as below screenshot where othe is coming up as 100% and is not correct.

deepalig_0-1716896631808.png

 

Can someone help me in this?


Thank you in advance!


1 ACCEPTED SOLUTION
deepalig
Frequent Visitor

Hi All, 

Its resolved. Solved by modifying Brand Share% measure. Used All in place of Allselected fulfilled my requirement. 

Thank you 

 

View solution in original post

2 REPLIES 2
deepalig
Frequent Visitor

Hi All, 

Its resolved. Solved by modifying Brand Share% measure. Used All in place of Allselected fulfilled my requirement. 

Thank you 

 

Anonymous
Not applicable

Hi, @deepalig 

Glad to hear you solved the problem yourself!  

Congratulations

 

Best Regards

Yongkang Hua

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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