Forum Discussion

iabarraganc's avatar
iabarraganc
Icon for Helper I rankHelper I
4 years ago
Solved

Top N with static values

Hi. I have a dimension table with the attributes of a product, and another table (also with dimensions) with the warehouses where it is sold. I need to generate initially a top of which are the pro...
  • v-robertq-msft's avatar
    4 years ago

    Hi, 

    According to your description, I can roughly understand your requirement, you want to generate initially a top of which are the products that sell the most at a general level like top 3, right? I think you can try this method to achieve your requirements:

    This is the test data I created based on your description:

     

    You can create a measure [Flag] like this:

    Flag =
    
    var _summarize=SUMMARIZE(ALL('Table'),'Table'[Product],"Value",SUM('Table'[Value]))
    
    var _top3=TOPN(3,_summarize,[Value],DESC)
    
    var _product=SELECTCOLUMNS(_top3,"1",[Product])
    
    return
    
    IF(MAX('Table'[Product]) in _product,1,0)

     

    And you can go to create a table chart and apply the visual filer to get what you want, like this:

     

    You can download my test pbix file below

     

    If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

    How to Get Your Question Answered Quickly 

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.