Forum Discussion

S2's avatar
S2
New Member
5 years ago
Solved

Merge, Add, Subtotal, Filter by User

I'm a rookier Power BI user. My desired outcome: Total number of reports. Total number of reports for each author that includes when they coauthored. I want to filter by author that calculates the a...
  • v-henryk-mstf's avatar
    5 years ago

    Don't @S2,


    According to your requirements, I tried one of the simplest methods, which can be used as a reference: create three measures to count the number of Author, CoAuthor1, and CoAuthor2 columns. Create another table and accumulate the obtained number.

    Measure1 = 
    CALCULATE(
        DISTINCTCOUNT('Table'[Report Types]),
        ALLEXCEPT('Table', 'Table'[Author])
    )
    Measure 2 = 
    CALCULATE(
        DISTINCTCOUNT('Table'[Report Types]),
        ALLEXCEPT('Table', 'Table'[CoAuthor1]),
        FILTER( 'Table', [CoAuthor1] <> BLANK() )
    )
    Measure 3 = 
    CALCULATE(
        DISTINCTCOUNT('Table'[Report Types]),
        ALLEXCEPT('Table', 'Table'[CoAuthor2]),
        FILTER( 'Table', [CoAuthor2] <> BLANK() )
    )

    Put the measurement in the table:

    v-henryk-mstf_0-1610965110700.png

    Create a new table and add the Sum_Author:

    Table 2 = 
    VAR t1 = 
    SUMMARIZE(
        'Table', [Author],
        "R", [Measure1]
    )
    VAR t2 = 
    SUMMARIZE(
        'Table', [CoAuthor1],
        "R", [Measure 2]
    )
    VAR t3 = 
    SUMMARIZE(
        'Table', [CoAuthor2],
        "R", [Measure 3]
    )
    RETURN
    UNION(
        t1, t2, t3
    )

    v-henryk-mstf_1-1610965273403.png

    If the problem is not yet resolved, provide detailed information about the error and let me know immediately, waiting for your response.


    Best regards
    Henry


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