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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
buttercream
Frequent Visitor

Multiple Top N

Hi,

 

I have 2 tables.

Table1

CategoryProduct
FruitsApple
FruitsBanana
FruitsKiwi
FruitsMango
VegetablesCelery
VegetablesLettuce
VegetablesCarrot
VegetablesOnion
GrainsRice
GrainsBread
GrainsPasta
GrainsBeans
MeatsChicken
MeatsBeef
MeatsTurkey

 

Table 2

DateProductSale
2/5/2024Banana4
2/5/2024Lettuce19
2/5/2024Onion14
2/5/2024Beans5
4/10/2024Lettuce13
4/10/2024Carrot12
4/10/2024Onion18
4/10/2024Mango14
4/10/2024Chicken20
4/10/2024Beef20
4/10/2024Beans15
5/1/2024Beans19
5/1/2024Rice18
5/1/2024Onion12
5/1/2024Lettuce7
5/1/2024Celery17
5/1/2024Carrot18
5/1/2024Banana10

 

I am trying to get a visual that shows top 2 categories for the latest date selected via a date slicer.  Example if no date is selected in slicer would default to 5/1/2024 (latest date).

CategorySale
Vegetables54
Grains37

 

How do I achieve this?

1 ACCEPTED SOLUTION
collinq
Super User
Super User

Hy @buttercream ,

 

Assuming that you have a DateDimension that is linked to the sales date and assuming that you are linking the two examples based on the Product field; then the Top N will get you want you want.  By doing this version you get it by date:

collinq_0-1724779563763.png

 

collinq_1-1724779578069.png

 

 

 

If you want to ignore the  date, change the top N by Sale instead of Date

collinq_2-1724779624889.png

 

collinq_3-1724779636500.png


If you want to have this done by a specific date, you could use either method and then make a Dax date of "latest date" and then put that into the filter for the visual.

 

 




Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!
Private message me for consulting or training needs.




View solution in original post

1 REPLY 1
collinq
Super User
Super User

Hy @buttercream ,

 

Assuming that you have a DateDimension that is linked to the sales date and assuming that you are linking the two examples based on the Product field; then the Top N will get you want you want.  By doing this version you get it by date:

collinq_0-1724779563763.png

 

collinq_1-1724779578069.png

 

 

 

If you want to ignore the  date, change the top N by Sale instead of Date

collinq_2-1724779624889.png

 

collinq_3-1724779636500.png


If you want to have this done by a specific date, you could use either method and then make a Dax date of "latest date" and then put that into the filter for the visual.

 

 




Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!
Private message me for consulting or training needs.




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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