Forum Discussion
Engagement Role Report - Calculated Column question
In Power BI Desktop, we don’t have such a visual which can completely show result as you expect. If we use a Matrix, we can set “Engagement Name” as Rows and “Role” as Columns. But the Values always aggregates and only accepts numeric values, which means if we put “User Name” into Values, it will always be converted to “Count of User Name” instead of showing the actual User Name.
You may think that we can create a table report with a Salesperson measure, PM measure, and architect measure. But this is feasible only when there is no duplicate Allocation IDs in each Engagements. We cannot make the measure aggregate multiple Names when there’re duplicate Allocations.
We can use an alternate solution by creating a Matrix table as below, which marks the User Name with “1” under each Role. If one role have two or more users, multiple User Names will be marked with “1” under one Role.
Regards,
v-sihou-msft and Vvelarde,
Thank you both for taking the time to respond. This was a "want" of one of my managers, not a critical need. If I revisit this and come up with a solution I will post back.
Thanks,
- v-sihou-msft10 years agoMicrosoft Employee
I’ve worked out this problem now. We can use CONCATENATEX function to concatenates multiple names in different rows. Please refer to following steps.
The relationship between three tables is like below.
- Create a calculated column in Managers Table which stores the user names.
NameColumn = RELATED ( Users[Name] )
- Create a measure which count rows for each engagement.
EngagementRows = CALCULATE ( COUNTROWS ( 'Managers Table' ), ALLEXCEPT ( 'Managers Table', 'Managers Table'[EngagementID] ) ) - Create a measure for sales names in each Engagement.
Sales = CALCULATE ( CONCATENATEX ( 'Managers Table', 'Managers Table'[NameColumn], ", " ), FILTER ( 'Managers Table', 'Managers Table'[Allocation ID] = 1 && 'Managers Table'[ID] <= MAX ( 'Managers Table'[ID] ) && 'Managers Table'[ID] > MAX ( 'Managers Table'[ID] ) - [EngagementRows] ) ) - Create a measure for managers names in each Engagement.
Manager = CALCULATE ( CONCATENATEX ( 'Managers Table', 'Managers Table'[NameColumn], ", " ), FILTER ( 'Managers Table', 'Managers Table'[Allocation ID] = 2 && 'Managers Table'[ID] <= MAX ( 'Managers Table'[ID] ) && 'Managers Table'[ID] > MAX ( 'Managers Table'[ID] ) - [EngagementRows] ) ) - Create a measure for architects names in each Engagement.
Architect = CALCULATE ( CONCATENATEX ( 'Managers Table', 'Managers Table'[NameColumn], ", " ), FILTER ( 'Managers Table', 'Managers Table'[Allocation ID] = 3 && 'Managers Table'[ID] <= MAX ( 'Managers Table'[ID] ) && 'Managers Table'[ID] > MAX ( 'Managers Table'[ID] ) - [EngagementRows] ) ) - Drag Table chart into your canvas and select values as below. Set Totals to “Off” in Table Format –> General.
- Create a calculated column in Managers Table which stores the user names.