cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
admin11
Memorable Member
Memorable Member

Expression to replace filter TOP N = 10 sales by Brand ?

Hi All,

 

My SALES YTD expression as below :-

Sales YTD = CALCULATE ( [SALES_M],DATESYTD('DATE'[Date]))

 

Now i am using filter to display Top 10 sales by Brand :-

 

admin11_0-1656279331341.png

May i know how to create a expression to replace above Top N filter on this visusal  ?

 

Sone thing like below , which is not work  :-

Flag Top 10 Brand = CALCULATE ( [SALES_M],DATESYTD('DATE'[Date],BRAND_5)TOP_N=10)

 

Paul Yeo

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Drag Brand 5 to the rows section of a Table visual and drag this measure

=calculate([Sales_m],Top(10,all(Data[Brand_5]),[Sales_m]),values(Data[Brand_5]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Drag Brand 5 to the rows section of a Table visual and drag this measure

=calculate([Sales_m],Top(10,all(Data[Brand_5]),[Sales_m]),values(Data[Brand_5]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Seanan
Super User
Super User

Hi @admin11 

You can create new table using the following code and replacing [Company] for Brand and [Measure4] with your SalesYTD measure.

The "Total Sales" is the column name so you can name that anything you want.

 

TestingTop10 = TOPN(10,SUMMARIZE('SalesTeam','SalesTeam'[Company],"Total Sales",'SalesTeam'[Measure 4]))

 

 Then go to the relationships page and create a relationship using the brand column.

NVIDIA_Share_tYePRU3XTV.png

 

 

 

 

 

 

 

Once done you can use the columns from your new table to return the top 10 brands and then the rest of your measures/columns can be used from the original table.

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors