Forum Discussion

TesterDiseño's avatar
TesterDiseño
New Member
1 year ago
Solved

PowerBi Matriz Ranking Cliente Articulo

Estimados,   Quiero hacer una matriz de cliente (columnas) y articulo (filas). Tienen que aparecerme el top10 de cada una.   Puede ser que el cliente A sera el n° 5, y con el articulo 5° no tenga...
  • v-tejrama's avatar
    1 year ago

    Hi  TesterDiseño ,

    Thanks for reaching out to the Microsoft fabric community forum.

     

    To sort a matrix in Power BI by each customer's total sales for the year 2022, start by creating a Calendar table and building a relationship with the Sales table using the Date column. Then, define a DAX measure to rank customers based on their 2022 sales using the formula:

     

    Here is the DAX :

    Rank 2022 = IF(ISINSCOPE(Sales[Customer]), RANKX(ALL(Sales[Customer]), CALCULATE(SUM(Sales[Sales Value]), 'Calendar'[Year] = 2022), , DESC, SKIP))


    Add a matrix visual with Customer in Rows, Product in Columns (optional), and Sales Value in the Values area.

    Include the Rank 2022 measure (either in Values or Tooltip), then sort the matrix by Rank 2022 in descending order. This approach displays customers ordered by their total sales in 2022, even if other slicers are applied

     

    Please find the attached pbix file for your reference.

     

    Best Regards,

    Tejaswi.

    Community Support