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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
NandhuE31
Frequent Visitor

Show all values for specific segment and show top 3 for others - RANKX

I have the following structure of data. 

CategorySegmentBrandSales
AS1B1100
AS1B20
AS2B3120
AS5B4140
AS1B920
AS1B2125
AS2B33130
AS5B2090
AS1B100



I want to show sales for all the Segment S1 and Top 3 in other Brands. 

Result expected : 

CategorySegmentBrandSales
AS1B1100
AS1B20
AS1B920
AS1B2125
AS1B920
AS1B100
AS5B4140
AS2B33130
AS2B3120
1 ACCEPTED SOLUTION

Hi, @NandhuE31 , you might want to try a more flexible pattern; you can slicer the segments for keep certain segment while filtering other segments down to top 3. Pls refer to the attached file for details.

Screenshot 2020-11-29 141112.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

3 REPLIES 3
NandhuE31
Frequent Visitor

I have other filters in the data. It would be difficult to make them work asd calculated table .

Can it be done as measure or as calculated column?

Hi, @NandhuE31 , you might want to try a more flexible pattern; you can slicer the segments for keep certain segment while filtering other segments down to top 3. Pls refer to the attached file for details.

Screenshot 2020-11-29 141112.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

sanalytics
Super User
Super User

Hi @NandhuE31 

 

Assuming you want your expected result as Calculated Table

Then below Dax can help to achive this

sanalytics_0-1606630265847.png

Attached link is the Power BI file

https://dropfiles.org/Ml63iGvD

 

Regards

sanalytics

if it is your solution then please like and please accept it as solution

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors