Forum Discussion
Need help matrix table
- 1 year ago
Hi Hikmet_JCI
Thank you for using Microsoft Community Forum.
You can absolutely use your logic both in a calculated column for a table and in a matrix visual in Power BI. Here’s how you can approach both:
1. Calculated Column in a Table, To display this classification logic in a table visual, create a calculated column in Power BI using this DAX:
Category = IF ('Table'[Lead] <= 0 && 'Table'[Quota (%)] < 0.80,
"SS",IF ('Table'[Lead] = 0,"S",IF ('Table'[Lead] < 4,"L",IF ('Table'[Lead] = 4,"M","H"))))- Go to your table in Data view. Click New Column and paste the above code. this will create a new column (e.g., Category) with values like SS, S, L, M, or H depending on your conditions.
2. Use in a Matrix Visual, Now that you've created the column:
- Add a Matrix visual to your report.
- Use the new Category column in Rows or Columns, depending on how you want to group.
- Add your numeric values (e.g., Lead, Quota (%), etc.) in Values.
- You can also use the same logic directly in a measure if needed for calculations.
If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
I guess, you have double count
If lead <=0 for 5 items and 3 items in this 5 items, 3 have Quota = 0
You should have 5 S and 3 SS OR 2S and 3 SS
For the first case, I would suggest to create 3 measures and put them in a table
For the second case, I would create one calculated colum with the following dax:
Values =
IF(TestMatrix[Lead] <=0,"S",
IF(TestMatrix[Lead] > 0, "H",
IF(TestMatrix[Lead] <=0 && TestMatrix[Quota] = 0, "SS")))And add this column in the Column and the values of a Matrix
Do not hesistate if you need more help