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

Create a report from two Lists-with multiple text column lookup field

Trying to generate a report, in power bi, to list Managers who have resigned, the company and other Managers from 2 lists:

Companies List:  CompanyID, Company Name, Managers Name(lookup from Managers List-multiple values field-can be 1, 2, 3 or 4)

Managers List: ManagerID, Name of the Manager(unique), Status(Active or Resigned)

 

If the status in the “Managers List” is “Resigned”, then List the name of the company from the “Companies List”, the name of the Manager from the “Managers List” and all Managers Name(may be 1,2, 3 or 4) from the Companies List along with him. 

Thanks.

1 ACCEPTED SOLUTION

Hi, @Anonymous 

 

I'd like to suggest you create a calculated table and a measure as below. There is no relationship between tables. The pbix file is attached in the end.
Calculated table:

Table = 
CALCULATETABLE(
    DISTINCT('Manager List'[ManagerName]),
    FILTER(
        ALL('Manager List'),
        [Status]="Resigned"
    )
)

 

Measure:

Visual Control = 
var c = 
COUNTROWS(
    FILTER(
        DISTINCT('Table'[ManagerName]),
        CONTAINSSTRINGEXACT(MAX('Company List'[Board Managers]),[ManagerName])
    )
)+0
return
IF(
    c>0,
    1,0
)

 

Then you need to put the measure in the visual level filter and use 'ManagerName' from 'Table' to filter the result.

c1.png

 

Best Regards

Allan

 

If this post helps,then consider Accepting it as the solution to help other members find it faster.

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Thanks Allan, 

it works fine now... thanks:)

v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your descripton, I created data to reproduce your scenario. The pbix file is attached in the end.

Manager:

h1.png

 

Company:

h2.png

 

 

 

You may create a measure as below.

Result Status = 
IF(
    CONTAINSSTRINGEXACT(MAX(Company[BoardManagers]),MAX(Manager[ManagerName]))&&MAX(Manager[Status])="Resigned",
    "Resigned",
    "Active"
)

 

Result:

h3.png

 

Best Regards

Allan

 

If this post helps,then consider Accepting it as the solution to help other members find it faster.

Anonymous
Not applicable

Thanks Allan for your efforts, however, I am not getting the same results as you, may be due to the relationship issue. 

The ManagerName field in Manager is unique name of the person and the BoardManagers field in Company is a multiple text field and that too is a Lookup to ManagerName field in Manager List.

Appreciate your comments.

Hi, @Anonymous 

 

Could you please show us some sample data about two tables and the expected result? What is the relationship between two tables? Do mask sensitive data before uploading. Thanks.

 

Best Regards

Allan

Anonymous
Not applicable

Dear Allan, Thanks for your efforts, I copy the screenshot as required:

laiksayy3_0-1605598402893.pnglaiksayy3_1-1605598430486.png

Can you suggest the relationship here, as I am not sure about the relationship b/w these two files? Ideally it should be 'Company List'[BoardManagers] and 'Manager List'[ManagerName], but I think it is a data type mismatch here b/w multiple text field and single text field.

The expected output is to list all Managers(Resigned) only, once we click on any Managers(Resigned), the next two column should list the CompanyName and the ManagerName, for example if we click Mgr7, it should list the Company and ManagerName on the next column

laiksayy3_2-1605598501137.png

Kind regards.

Laik

Hi, @Anonymous 

 

I'd like to suggest you create a calculated table and a measure as below. There is no relationship between tables. The pbix file is attached in the end.
Calculated table:

Table = 
CALCULATETABLE(
    DISTINCT('Manager List'[ManagerName]),
    FILTER(
        ALL('Manager List'),
        [Status]="Resigned"
    )
)

 

Measure:

Visual Control = 
var c = 
COUNTROWS(
    FILTER(
        DISTINCT('Table'[ManagerName]),
        CONTAINSSTRINGEXACT(MAX('Company List'[Board Managers]),[ManagerName])
    )
)+0
return
IF(
    c>0,
    1,0
)

 

Then you need to put the measure in the visual level filter and use 'ManagerName' from 'Table' to filter the result.

c1.png

 

Best Regards

Allan

 

If this post helps,then consider Accepting it as the solution to help other members find it faster.

DavisBI
Solution Specialist
Solution Specialist

Hi, @Anonymous 

Can you provide a screenshot to show the result you want to achieve?


Anonymous
Not applicable

Thanks Davis for your response.

Attached is a screen shot, hope that makes it clear, please let me know should you need to know more info.

laiksayy3_0-1605508408990.png

 

 

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.