Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
S2
New Member

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 author's total without adding to the total reports. 

 

Here's my table:

AuthorReport TypesCoAuthor1CoAuthor2
TomA1Betty 
BettyA2  
DebbieA4  
DebbieA5TomJuan
TomA9  
JuanA1  
JuanA3Mary 
BobA2  
MaryA2DebbieBob
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@S2 , I think you can unpivot the table and use that

https://radacad.com/pivot-and-unpivot-with-power-bi

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

v-henryk-mstf
Community Support
Community Support

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.

View solution in original post

5 REPLIES 5
v-henryk-mstf
Community Support
Community Support

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.

Great!  Thank you.

Hi @S2 ,

 

Thank you for your approval.😆

 

If my reply also provides help or another idea, you may consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,
Henry

 

amitchandak
Super User
Super User

@S2 , I think you can unpivot the table and use that

https://radacad.com/pivot-and-unpivot-with-power-bi

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

So I did try that but when I filtered using a slicer the authors were referencing coauthors.  For example, when selecting Bob, Mary's reports will be calculated.  Any idea what I'm doing wrong?  Also, would you recommend merging or appending the columns? 

 

Thank you. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.