Forum Discussion
Matrix Visualisation
- 2 years ago
Hi Vincent_wong
Yes, you can do something like that. I have attached a small example using your data.
1. I recommend adding a column in Power Query containing the concatenation of columns delimited by line feeds:
2. Create an Index table containing a single column Index, which contains indexes from 1 up to the maximum number of Jobs that you might need to display in one column.
3. Create measures as follows:
Job Label by Index = VAR CurrentIndex = SELECTEDVALUE ( Index[Index] ) VAR JobSummary = SUMMARIZE ( Jobs, Jobs[Job #], Jobs[Job Label] ) RETURN SELECTCOLUMNS ( INDEX ( CurrentIndex, JobSummary, ORDERBY ( Jobs[Job #] ) ), Jobs[Job Label] )Job Label Colour = VAR CurrentIndex = SELECTEDVALUE ( Index[Index] ) VAR JobSummary = SUMMARIZE ( Jobs, Jobs[Job #], Jobs[Status] ) VAR JobStatus = SELECTCOLUMNS ( INDEX ( CurrentIndex, JobSummary, ORDERBY ( Jobs[Job #] ) ), Jobs[Status] ) RETURN SWITCH ( JobStatus, "Done", "#92D050", -- green "In Progress", "#FFFF00" -- yellow )3. Construct Matrix visual as follows, with Background Color conditional formatting using the field Job Label Colour:
4. I didn't worry about the legend, but you can create that separately.
Does something like this work for you?
Regards
Hi Vincent_wong
Yes, you can do something like that. I have attached a small example using your data.
1. I recommend adding a column in Power Query containing the concatenation of columns delimited by line feeds:
2. Create an Index table containing a single column Index, which contains indexes from 1 up to the maximum number of Jobs that you might need to display in one column.
3. Create measures as follows:
Job Label by Index =
VAR CurrentIndex = SELECTEDVALUE ( Index[Index] )
VAR JobSummary =
SUMMARIZE ( Jobs, Jobs[Job #], Jobs[Job Label] )
RETURN
SELECTCOLUMNS (
INDEX ( CurrentIndex, JobSummary, ORDERBY ( Jobs[Job #] ) ),
Jobs[Job Label]
)Job Label Colour =
VAR CurrentIndex = SELECTEDVALUE ( Index[Index] )
VAR JobSummary = SUMMARIZE ( Jobs, Jobs[Job #], Jobs[Status] )
VAR JobStatus =
SELECTCOLUMNS (
INDEX ( CurrentIndex, JobSummary, ORDERBY ( Jobs[Job #] ) ),
Jobs[Status]
)
RETURN
SWITCH (
JobStatus,
"Done", "#92D050", -- green
"In Progress", "#FFFF00" -- yellow
)
3. Construct Matrix visual as follows, with Background Color conditional formatting using the field Job Label Colour:
4. I didn't worry about the legend, but you can create that separately.
Does something like this work for you?
Regards
Thanks Owen. What if the Job# is already in numeric but not in sequence ? Do I still need to create index column ?