Forum Discussion
PowerBi Matriz Ranking Cliente Articulo
- 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
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
- v-tejrama1 year agoCommunity Support
Hi TesterDiseño ,
Just checking in have you been able to resolve this issue? If so, it would be greatly appreciated if you could mark the most helpful reply accordingly. This helps other community members quickly find relevant solutions.
Thank you.
- TesterDiseño1 year agoNew Member
V-tejrama,
Thanks a lot for you answer.
Best regards.,