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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ryan_b_fiting
Post Patron
Post Patron

TopN - Only SUM TopN Items for Category Total

Hello - 

 

I am having some issues with my TopN reporting.  I have a Brand Groups and then each Brand has several items associated with them.  I am trying to get the TopN Items within each group (which I am able to do and slice by) as you can see in the Matrix screen shot below.

 

My issue comes in the trending chart below.  I am only showing the Brand Groups on the chart (items are not a dimension in this chart anywhere).  I want this trend by brand to sum ONLY the TopN items that I have chosen in my slicer (screen shot example is Top 5).  But being the Item Type is not in the chart, it sums EVERYTHING for the brand rather than just the TopN sliced.

 

TopN Issues.png

 Here are my mesures I am using to get my matrix to work for me.

 

 

TopN $ = VAR SelectedTop = SELECTEDVALUE('TopN'[TopN])
RETURN
SWITCH(TRUE(),
    SelectedTop = 0, [Total Sales ($)],
    RANKX ( 
            ALLSELECTED(  'Competitor Sales'[ITEM_DESCRIPTION] ),
            [Total Sales ($)]
                )
                  <= SelectedTop,
        [Total Sales ($)]
)

TopN Control = IF(ISBLANK([TopN $ Flavors]),0,1)

 

.The TopN Control is used as a filter to only sum the TopN selection at the brand level.

 

My question, how can I get the Brand Trend Chart to SUM ONLY the TopN selection for Sales rather than the entire Sales for the brand?

 

Any help is greatly appecirated!

Thank You

Ryan

 

2 ACCEPTED SOLUTIONS
VijayP
Super User
Super User

Hi @ryan_b_fiting , if I have understood your question properly , this could be the solution.
I have created a simple TOPN Function and it is working similar in both the visulas.
 
TopN = CALCULATE([Total Revenue],TOPN(5,all(Revenue[Customer]),[Total Revenue],DESC),VALUES(Revenue[Customer]))
 
Please let me know if it helps!
Vijay Perepa
watch my videos on www.youtube.com/perepavijay
 

2020-04-10_083836.png




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


View solution in original post

Will this do?? 

if not just give me a small snap what exactly you want in a picture so that I should be able to answer

Regards

Vijay Perepa

 

2020-04-10_083836.png




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


View solution in original post

4 REPLIES 4
VijayP
Super User
Super User

Hi @ryan_b_fiting , if I have understood your question properly , this could be the solution.
I have created a simple TOPN Function and it is working similar in both the visulas.
 
TopN = CALCULATE([Total Revenue],TOPN(5,all(Revenue[Customer]),[Total Revenue],DESC),VALUES(Revenue[Customer]))
 
Please let me know if it helps!
Vijay Perepa
watch my videos on www.youtube.com/perepavijay
 

2020-04-10_083836.png




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


@VijayPalmost but not quite (I don't think,).  what I would need to see in the case of your example would be 2 lines as legends (for the cities) for 4.06MM and 3.21MM for January.

 

Does that make sense the way I put it above?  I need to be able to compare the trends by brands for the TopN items they sell.

Will this do?? 

if not just give me a small snap what exactly you want in a picture so that I should be able to answer

Regards

Vijay Perepa

 

2020-04-10_083836.png




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Excellent I just did a quick test and it is doing exactly as I want! 

 

Thank you so much!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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