Forum Discussion

RSSAPowerBI's avatar
RSSAPowerBI
New Member
1 year ago
Solved

Ranking for Sales Transactions Listing

Hello,   I currently have a sales listing (indicating all sales transactions for 2023 and 2024). This listing includes the date, product name, sales amount and the sales channel.   For example: ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi, RSSAPowerBI 

    The use of pie charts can react to the problem of occupancy, and you can try to solve your problem using the following methods.



    Varies with Slicer's choice:

     

     

    Sales Except Product = 
    CALCULATE(SUM('Table'[Sales amount]),ALLEXCEPT('Table','Table'[Product]))
    
    Rank = RANKX(ALLSELECTED('Table'),[Sales Except Product],,DESC,Dense)
    
    Sales = 
    VAR _rankTop10 = RANKX(ALLSELECTED('Table'),[Sales except product],,DESC,Dense)
    VAR _rankBottom10 = RANKX(ALLSELECTED('Table'),[Sales except product],,ASC,Dense)
    VAR _allsales = CALCULATE(SUM('Table'[Sales amount]),ALL())
    VAR _proportions = DIVIDE([Sales except product],_allsales)
    VAR _slicer = SELECTEDVALUE(Slicer[RankSales])
    VAR _result = SWITCH(
        _slicer,
        "Top 10",IF(_rankTop10<=10,_proportions),
        "Bottom 10",IF(_rankBottom10<=10,_proportions),
        _proportions
    )
    RETURN
    _result

     

    Best Regards,
    Yang

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know.
    Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum