Reply
buttercream
Helper I
Helper I
Partially syndicated - Outbound

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

Syndicated - Outbound

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

Syndicated - Outbound

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.




avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)