Forum Discussion
Matrix - Hide/Show secondary Rows in matrix
- 9 months ago
Things are getting clearer now, you can’t make a field parameter itself add/remove extra levels, but you can simulate it., create a conditional field (measure) that only returns TrackList[Title] when the selected parameter = “Artist,” and returns BLANK() otherwise, then add that measure as the second row in your matrix. Power BI automatically hides a matrix level if it only contains blanks, so the secondary row will appear only when “Artist” is chosen.
Did it work? 👍 A kudos would be appreciated
🟨 Mark it as a solution to help spread knowledge 💡
Hi StevenT
You can let users pick dimensions with a field parameter. If they choose Product Category, you add a simple DAX rule so Segment shows up under it. If they pick Country, that rule hides Segment the matrix then adapts naturally to their choice.
Did it work? 👍 A kudos would be appreciated
🟨 Mark it as a solution to help spread knowledge 💡
- StevenT9 months agoHelper V
I use a field parameter for the primary level (first row). How would I build it so that if a user picks one from the main parameter, a secondary row appears or hides if there is no secondary needed?
Here's my field parameterCategory = {("Title", NAMEOF('TrackList'[Title]), 0),("Genre", NAMEOF('Genre'[Genre]), 1),("Artist", NAMEOF('Artist'[Artist]), 2),("Album", NAMEOF('Album'[Album]), 3),("Record Label", NAMEOF('RecordLabel'[RecordLabel]), 4),("Region", NAMEOF('Region'[Region]), 5),("Retail Sales - Tracks", NAMEOF('PurchasedFrom'[PurchasedFrom]), 6),("Retail Sales - Albums", NAMEOF('PurchasedFrom'[Purchased From]), 7)}
what I would want is something like if the pick artist, the secondary row appears which would be TrackList([Title]), but if they pick any other, it dissapears or is hidden in the matrix..- DataVitalizer9 months agoSuper User
Things are getting clearer now, you can’t make a field parameter itself add/remove extra levels, but you can simulate it., create a conditional field (measure) that only returns TrackList[Title] when the selected parameter = “Artist,” and returns BLANK() otherwise, then add that measure as the second row in your matrix. Power BI automatically hides a matrix level if it only contains blanks, so the secondary row will appear only when “Artist” is chosen.
Did it work? 👍 A kudos would be appreciated
🟨 Mark it as a solution to help spread knowledge 💡