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
Anonymous
Not applicable

2 Tables Validation - HELP

The goal is to identify the "Owner" of the ticket metrics we have from an external source.  We have almost gotten this with the script below, but are still having trouble with many showing "unassigned" that should not.  We want to automate this report instead of manipulating this report and then forwarding it to Power BI.  This is what we are trying:

 

Table1 - 'IS Service - Data List'

[Home Team]                                       [Team: Name]

Apps Document Management            Apps Document Management                     

                                                            IDM & Messaging

Apps Tata NA Open Systems              

   

[Assignments]                                                                                              

Lewis Stanley, Syed Mashady, Team: Apps Document Management         

Team: IDM & Messaging

Abhishek Agarwal

 

[Assignments2]

Lewis Stanley, Syed Mashady, Team: Apps Document Management 

Team: IDM & Messaging

Abhishek Agarwal

 

Table 2 - 'Home Team Owners New'

[Hometeam]                                    [Owner]

Apps Document Management       Dale Durham

IDM & Messaging                           JR Foster

Apps Tata NA Open Systems          Surendrath Illathur

 

 

I am open to any suggestions, but the coding we may need some assistance with.

 

The Current Script:

 

Manager =
VAR HomeTeam1 =
CALCULATE (
FIRSTNONBLANK ( 'Home Team Owners New'[Owner], 1 ),
FILTER (
'Home Team Owners New',
'Home Team Owners New'[Hometeam]
= MAX ( 'IS Service Request - Data List'[Home Team] )
)
)
VAR HomeTeam2 =
CALCULATE (
FIRSTNONBLANK ( 'Home Team Owners New'[Owner], 1 ),
USERELATIONSHIP ( 'IS Service Request - Data List'[Team: Name], 'Home Team Owners New'[Hometeam] ),
FILTER (
'Home Team Owners New',
'Home Team Owners New'[Hometeam]
= MAX ( 'IS Service Request - Data List'[Team: Name] )
)
)
VAR assignment1 =
CALCULATE (
FIRSTNONBLANK ( 'Home Team Owners New'[Owner], 1 ),
USERELATIONSHIP ( 'IS Service Request - Data List'[Assignments], 'Home Team Owners New'[Hometeam] ),
FILTER (
'Home Team Owners New',
'Home Team Owners New'[Hometeam]
= MAX ( 'IS Service Request - Data List'[Assignments] )
)
)
VAR assignment2 =
CALCULATE (
FIRSTNONBLANK ( 'Home Team Owners New'[Owner], 1 ),
USERELATIONSHIP ( 'IS Service Request - Data List'[Assignments2], 'Home Team Owners New'[Hometeam] ),
FILTER (
'Home Team Owners New',
'Home Team Owners New'[Hometeam]
= MAX ( 'IS Service Request - Data List'[Assignments] )
)
)
RETURN
IF (
HomeTeam1 = BLANK (),
IF (
HomeTeam2 = BLANK (),
IF (
assignment1 = BLANK (),
IF ( assignment2 = BLANK (), "Unassigned", assignment2 ),
assignment1
),
HomeTeam2
),
HomeTeam1
)

 

Any Help is greatly appreciated!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I have resolved this by doing this for each value and then Conatenate them together.

 

RES1 = LOOKUPVALUE('Home Team Owners'[Owners],'Home Team Owners'[Hometeam],SELECTEDVALUE('IS Service Request  - Data List'[Home Team],"Unassigned"))

 

RES1 = LOOKUPVALUE('Home Team Owners'[Owners],'Home Team Owners'[Hometeam],SELECTEDVALUE('IS Service Request  - Data List'[Home Team],"Unassigned"))

 

RES3 = IF([RES2]=BLANK(),LOOKUPVALUE('Home Team Owners 4'[Owners],'Home Team Owners 4'[Hometeam],SELECTEDVALUE('IS Service Request  - Data List'[Assignments2],"Unassigned")))

 

RES4 = IF([RES3]=BLANK(),LOOKUPVALUE('Home Team Owners 4'[Owners],'Home Team Owners 4'[Hometeam],SELECTEDVALUE('IS Service Request  - Data List'[Assignments2],"Unassigned")))

 

RES1-2 = CONCATENATE([RES1], [RES2])

 

RES1-2 = CONCATENATE([RES1], [RES2])

 

ALL RES = CONCATENATE([RES1-2],[RES3-4])

 

Manager = if([ALL RES]=BLANK(),"Unassigned",[ALL RES])

 

This will also ensure that if there are any table changes then there will be no issues.

 

Thank you for those who attempted to assist.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

 

Can you please share a sample pbix file for test? I think it will be help for coding formula.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable
Anonymous
Not applicable

I have resolved this by doing this for each value and then Conatenate them together.

 

RES1 = LOOKUPVALUE('Home Team Owners'[Owners],'Home Team Owners'[Hometeam],SELECTEDVALUE('IS Service Request  - Data List'[Home Team],"Unassigned"))

 

RES1 = LOOKUPVALUE('Home Team Owners'[Owners],'Home Team Owners'[Hometeam],SELECTEDVALUE('IS Service Request  - Data List'[Home Team],"Unassigned"))

 

RES3 = IF([RES2]=BLANK(),LOOKUPVALUE('Home Team Owners 4'[Owners],'Home Team Owners 4'[Hometeam],SELECTEDVALUE('IS Service Request  - Data List'[Assignments2],"Unassigned")))

 

RES4 = IF([RES3]=BLANK(),LOOKUPVALUE('Home Team Owners 4'[Owners],'Home Team Owners 4'[Hometeam],SELECTEDVALUE('IS Service Request  - Data List'[Assignments2],"Unassigned")))

 

RES1-2 = CONCATENATE([RES1], [RES2])

 

RES1-2 = CONCATENATE([RES1], [RES2])

 

ALL RES = CONCATENATE([RES1-2],[RES3-4])

 

Manager = if([ALL RES]=BLANK(),"Unassigned",[ALL RES])

 

This will also ensure that if there are any table changes then there will be no issues.

 

Thank you for those who attempted to assist.

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.