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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ld17
Helper II
Helper II

Show items with no data in a matrix

I am creating a matrix. My data looks like the below with the user's name and the names of the trainings they have completed. Not all users get assigned all trainings, but when I put this data into a matrix as shown in the second screenshot, it gives the visual appearance that they haven't completed the training. My issue is that I don't think "show items with no data" will work since my data only shows what was assigned to a user, not things that weren't assigned. I would like to use an "if statement" or something similiar so that the cell displays "not assigned" to show that the user didn't have to take that training. 

 

ld17_0-1674844640516.png

 

ld17_1-1674844839000.png

 

2 ACCEPTED SOLUTIONS
DataInsights
Super User
Super User

@ld17,

 

One solution is to create a calculated table consisting of all combinations of User Full Name and Training Title:

 

ReportingTable = 
CROSSJOIN ( VALUES ( TrainingTable[User - User Full Name] ), VALUES ( TrainingTable[Training - Training Title] ) )

 

In this calculated table, create a calculated column:

 

Completion Date = 
VAR vResult =
    CONVERT (
        LOOKUPVALUE (
            TrainingTable[Completion Date],
            TrainingTable[User - User Full Name], ReportingTable[User - User Full Name],
            TrainingTable[Training - Training Title], ReportingTable[Training - Training Title]
        ),
        STRING
    )
RETURN
    IF ( ISBLANK ( vResult ), "not assigned", vResult )

 

Create a matrix using the calculated table:

 

DataInsights_0-1674941169807.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

@ld17,

 

Try this:

 

Completion Date = 
VAR vStatus =
    LOOKUPVALUE (
        'Site Services Training Matrix'[Transcript - Transcript Status],
        'Site Services Training Matrix'[User - User Full Name], 'Table'[User - User Full Name],
        'Site Services Training Matrix'[Training - Training Title], 'Table'[Training - Training Title]
    )
VAR vResult =
    SWITCH (
        TRUE,
        vStatus = "Completed",
            CONVERT (
                LOOKUPVALUE (
                    'Site Services Training Matrix'[Transcript - Transcript Completed Date],
                    'Site Services Training Matrix'[User - User Full Name], 'Table'[User - User Full Name],
                    'Site Services Training Matrix'[Training - Training Title], 'Table'[Training - Training Title]
                ),
                STRING
            ),
        vStatus <> "Completed"
            && NOT ISBLANK ( vStatus ), vStatus,
        "Not Assigned"
    )
RETURN
    vResult

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

8 REPLIES 8
ld17
Helper II
Helper II

Hello again! Was wondering if I could get one more piece of help on this. I need to be able to distinguish between those who weren't assigned a training and those who are "in progress" or "not started" on a training. So I need some blanks to be transformed into "not assigned," and some need to say "in progress" "or registered." Is there a condition I can add onto the above statement to achieve this?  

 

ld17_1-1675274217455.pngld17_2-1675274284056.png

 

@ld17,

 

Would you be able to provide an example of each scenario and the expected result?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Absolutely! My two columns I am trying to reference are highlighted below:

 

ld17_0-1675695558965.png

 

After some tweaks, I have found that this DAX expression will produce the status, but removes the date since the date is in a separate column:

 

Completion Date = VAR vResult =

    CONVERT (

        LOOKUPVALUE (

            'Site Services Training Matrix'[Transcript - Transcript Status],

            'Site Services Training Matrix'[User - User Full Name], 'Table'[User - User Full Name],

            'Site Services Training Matrix'[Training - Training Title], 'Table'[Training - Training Title]

        ),

        STRING

    )

RETURN

    IF ( ISBLANK ( vResult ), "Not Assigned", vResult)

 

Gives me this result:

ld17_3-1675696385582.png

 

 

And this, the original I was working with, shows the date and "not assigned," but I cannot figure out how to get it to grab the other statues ("in progress, "in progress / past due," "or registered,") since they are in a different column:

 

Completion Date = VAR vResult =

    CONVERT (

        LOOKUPVALUE (

            'Site Services Training Matrix'[Transcript - Transcript Completed Date],

            'Site Services Training Matrix'[User - User Full Name], 'Table'[User - User Full Name],

            'Site Services Training Matrix'[Training - Training Title], 'Table'[Training - Training Title]

        ),

        STRING

    )

RETURN

    IF ( ISBLANK ( vResult ), "Not Assigned", vResult)

 

Gives me this result:

ld17_1-1675695787468.png

 

The result I want to achieve would look like the below (dates and statuses combined):

 

ld17_4-1675696846341.png

 

 

My question is: how do I write a DAX expression to reference both the date from the "transcript-transcript completed date" column (if the user has completed the training) as well as the statues from the "transcript-transcript status" column (if the user is in progress on a training)? Thanks in advance!

@ld17,

 

Try this:

 

Completion Date = 
VAR vStatus =
    LOOKUPVALUE (
        'Site Services Training Matrix'[Transcript - Transcript Status],
        'Site Services Training Matrix'[User - User Full Name], 'Table'[User - User Full Name],
        'Site Services Training Matrix'[Training - Training Title], 'Table'[Training - Training Title]
    )
VAR vResult =
    SWITCH (
        TRUE,
        vStatus = "Completed",
            CONVERT (
                LOOKUPVALUE (
                    'Site Services Training Matrix'[Transcript - Transcript Completed Date],
                    'Site Services Training Matrix'[User - User Full Name], 'Table'[User - User Full Name],
                    'Site Services Training Matrix'[Training - Training Title], 'Table'[Training - Training Title]
                ),
                STRING
            ),
        vStatus <> "Completed"
            && NOT ISBLANK ( vStatus ), vStatus,
        "Not Assigned"
    )
RETURN
    vResult

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Yes, this works absolutely perfect. Thank you for all of the help in firguring this out. Been sitting on this one for days. Really apprecate it!

@ld17,

 

Glad to hear that works!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




DataInsights
Super User
Super User

@ld17,

 

One solution is to create a calculated table consisting of all combinations of User Full Name and Training Title:

 

ReportingTable = 
CROSSJOIN ( VALUES ( TrainingTable[User - User Full Name] ), VALUES ( TrainingTable[Training - Training Title] ) )

 

In this calculated table, create a calculated column:

 

Completion Date = 
VAR vResult =
    CONVERT (
        LOOKUPVALUE (
            TrainingTable[Completion Date],
            TrainingTable[User - User Full Name], ReportingTable[User - User Full Name],
            TrainingTable[Training - Training Title], ReportingTable[Training - Training Title]
        ),
        STRING
    )
RETURN
    IF ( ISBLANK ( vResult ), "not assigned", vResult )

 

Create a matrix using the calculated table:

 

DataInsights_0-1674941169807.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




This works perfect! Thanks SO much!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.