Forum Discussion
Create KPI table with matrix table, with category and sub-category
- 1 year ago
Hi Angko2528 ,
In matrix only values can be conditionally formatted.
If you wish to have this feature implemented, you can post your idea in ideas forum.
https://ideas.powerbi.com/forums/265200 .
Hope this helps!
Hi Angko2528 ,
To display both Category and KPI in the rows of your Matrix visual in Power BI, make sure your data model includes a column for Category that maps each KPI to its correct group (such as A, B, C, etc. in your Excel). Once your data is imported, go to the Matrix visual and drag the Category column into the "Rows" field well, followed by the KPI column just beneath it. This will create a hierarchy where KPIs are listed under their corresponding Category. You can keep your existing "MÃ¥ned" (Month) field in the Columns well, and all your measure fields like Data1, Data2, etc. should remain in the Values well.
If your dataset doesn't yet have Category values tied to each KPI, you can add them manually in Power Query or create a new table with a relationship. Here's an example using DAX to create a new table that includes categories:
KPI_Category_Map = DATATABLE(
"KPI", STRING,
"Category", STRING,
{
{"data 1", "A"},
{"data 2", "B"},
{"data 3", "B"},
{"data 4", "B"},
{"data 5", "C"},
{"data 6", "C"},
{"data 7", "D"},
{"data 8", "D"},
{"data 9", "D"},
{"data 10", "E"},
{"data 11", "E"},
{"data 12", "E"},
{"data 13", "E"},
{"data 14", "E"}
}
)
After creating this table, establish a relationship between the KPI column in this new table and the existing KPI field in your main data table. Then, use the Category field from the new table in your Matrix visual. The Matrix will now show Categories as the outer row and KPIs nested beneath them, similar to how it's displayed in Excel.
Best regards,
- Angko25281 year agoFrequent Visitor
It's not possible to establish a relationship between that new table (KPI column) to my existing KPI field as existing KPI field show as more columns (KPI rows)
Existing tableDate Data 1 Data2 Data 3 xx xxx xxx xxx xxx xxx xx xx xx but that Category table
KPI Category Data 1 A Data 2 B Data 3 B
I know i can unpivot the existing table and drag category and KPI in rows but then I will miss possibility to add conditonal formating to the values.
maybe there is another way?