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
DianaT
Helper I
Helper I

KPI report: One project with two relationship managers

Dear community,

 

I am trying to build a KPI dash board that allows me to filter by relationship managers. My dataset looks like this:

 

Project IDRevenueManager 1Manager 2
150000PeterJane
230000Jane 
38000Simone 
410000Simone Kate
595000Fiona 
668000Peter Jane
725000Kate 

 

What I am trying do present is this:

 

Manager RevenueProject count
Peter1180002
Simone180002
Jane1480003
Fiona950001
Kate350002

 

The idea is that if a project is co-managed by two staff, both will get 100% credit for revenue and project count. But with the manager information spread over two columns a simple slicer just doesn't do it... What would be the next simplest solution to this?

 

Any guidance will be greatly appreicated.

 

Cheers,

Diana

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @DianaT ,

 

Here we go 🙂

Table 2 = 
VAR k =
    DISTINCT (
        UNION ( DISTINCT ( 'Table'[Manager 1] ), DISTINCT ( 'Table'[Manager 2] ) )
    )
VAR c =
    ADDCOLUMNS (
        FILTER ( k, 'Table'[Manager 1] <> BLANK () ),
        "man", 'Table'[Manager 1]
    )
VAR d =
    ADDCOLUMNS (
        c,
        "Revene", CALCULATE (
            SUM ( 'Table'[Revenue] ),
            FILTER ( 'Table', 'Table'[Manager 1] = [man] )
        )
            + CALCULATE (
                SUM ( 'Table'[Revenue] ),
                FILTER ( 'Table', 'Table'[Manager 2] = [man] )
            ),
        "count", CALCULATE (
            DISTINCTCOUNT ( 'Table'[Project ID] ),
            FILTER ( 'Table', 'Table'[Manager 1] = [man] )
        )
            + CALCULATE (
                DISTINCTCOUNT ( 'Table'[Project ID] ),
                FILTER ( 'Table', 'Table'[Manager 2] = [man] )
            )
    )
RETURN
    SELECTCOLUMNS ( d, "Manager", [man], "Reven", [Revene], "Count_P", [count] )

 

Capture.PNG

 

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @DianaT ,

 

Here we go 🙂

Table 2 = 
VAR k =
    DISTINCT (
        UNION ( DISTINCT ( 'Table'[Manager 1] ), DISTINCT ( 'Table'[Manager 2] ) )
    )
VAR c =
    ADDCOLUMNS (
        FILTER ( k, 'Table'[Manager 1] <> BLANK () ),
        "man", 'Table'[Manager 1]
    )
VAR d =
    ADDCOLUMNS (
        c,
        "Revene", CALCULATE (
            SUM ( 'Table'[Revenue] ),
            FILTER ( 'Table', 'Table'[Manager 1] = [man] )
        )
            + CALCULATE (
                SUM ( 'Table'[Revenue] ),
                FILTER ( 'Table', 'Table'[Manager 2] = [man] )
            ),
        "count", CALCULATE (
            DISTINCTCOUNT ( 'Table'[Project ID] ),
            FILTER ( 'Table', 'Table'[Manager 1] = [man] )
        )
            + CALCULATE (
                DISTINCTCOUNT ( 'Table'[Project ID] ),
                FILTER ( 'Table', 'Table'[Manager 2] = [man] )
            )
    )
RETURN
    SELECTCOLUMNS ( d, "Manager", [man], "Reven", [Revene], "Count_P", [count] )

 

Capture.PNG

 

Pbix as attached.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

This works beautifully! Thank you.

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.