Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
SigmundVoid
Frequent Visitor

Replace Blank Matrix Cells with Text

I've created a matrix visual that acts as a training matrix, showing for each of our employees their status on each course (completed, not started) etc.

Not every employee has the same courses assigned to them. For example in the image below, some employees have a blank cell for Anaphylaxsis in the matrix visual because they are not required to complete it. The dataset used to create this visual contains everyone's course status for every course assigned to them, so for people who don't have Anaphylaxsis assigned to them, they have no record relating to Anaphylaxsis in the original dataset, which is why their course status is blank in the matrix.

SigmundVoid_0-1697550246447.png

I want to replace the blank cells with the words 'not required' but am struggling. I created a table that just contains the possible course status options (using DISTINCT), and the used SWITCH to create a column replacing blank with 'not required'. I then defined the relationship between this new table and the original dataset (image below) hoping that this would replace the blank cells in the matrix with 'not required' but it hasn't.

SigmundVoid_1-1697550558887.png

I feel like there must be a simple way to replace blank text values in a matrix with some other text! Any help would be appreciated!

1 ACCEPTED SOLUTION
SigmundVoid
Frequent Visitor

Never mind I figured it out, needed to create a measure that would take the current value or replace blanks in the matrix:

Course status =
var CurrentItem = SELECTEDVALUE('Learning_Records'[Course status])
return IF( ISBLANK(CurrentItem )||CurrentItem = "", "Not required",  CurrentItem)
 

View solution in original post

3 REPLIES 3
SigmundVoid
Frequent Visitor

Never mind I figured it out, needed to create a measure that would take the current value or replace blanks in the matrix:

Course status =
var CurrentItem = SELECTEDVALUE('Learning_Records'[Course status])
return IF( ISBLANK(CurrentItem )||CurrentItem = "", "Not required",  CurrentItem)
 
KEAlexander
Helper I
Helper I

In the query editor, you could use "replace values" (see the transform tab) in the Course status column to replace blanks with "not required". 

This was my first thought but doesn't work in this case. There are no blank values in the course status column in the original dataset, only in the matrix. For example there are 30 training courses in total, but an employee might only be required to complete 20 of them. They have no record in the original dataset of the 10 courses they don't need to complete, and therefore have a blank value for these courses in the course status column in the matrix, where every course is shown whether an employee needs to complete it or not.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors