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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
PantherusNZ
Helper I
Helper I

How to Build Measure to extract distinct rows from a table based on multiple possible criteria

I have a table of support ticket items displaying tickets assigned to various support teams, as well as line items if they've been transferred to or from teams - so there are duplicated line items throughout the data.  I need to report on how many tickets were managed by a number of teams through the time period.

 

So I want to build a series of measures to pull the numbers of tickets that are either assigned to Team X, were transferred to Team X, or were transferred FROM Team X - and it needs to avoid duplicates - so if a ticket is assigned to that team, was transferred to them, and was transferred from them, it would only return 1 for this filter.

 

I'm struggling to write the measure - previously I've done CALCULATE(COUNTROWS([Table]),FILTER([Column]="criteria")) but I've not done multiple criteria of distincts.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PantherusNZ 

 

Thank you very much Ritaf1983  for your prompt reply, please allow me to share some content here.

 

Here's some dummy data

 

“Table”

vnuocmsft_0-1723188561644.png

 

Create a measure.

 

Total_Tickets_Managed_By_Team = 
VAR _SelectTea = SELECTEDVALUE('Table'[AssignedTeam])
RETURN
CALCULATE(
    COUNTROWS('Table'),
    FILTER(
        'Table',
        'Table'[AssignedTeam] = _SelectTea ||
        'Table'[TransferredToTeam] = _SelectTea ||
        'Table'[TransferredFromTeam] = _SelectTea
    )
)

 

Here is the result.

 

vnuocmsft_1-1723188621554.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @PantherusNZ 

 

Thank you very much Ritaf1983  for your prompt reply, please allow me to share some content here.

 

Here's some dummy data

 

“Table”

vnuocmsft_0-1723188561644.png

 

Create a measure.

 

Total_Tickets_Managed_By_Team = 
VAR _SelectTea = SELECTEDVALUE('Table'[AssignedTeam])
RETURN
CALCULATE(
    COUNTROWS('Table'),
    FILTER(
        'Table',
        'Table'[AssignedTeam] = _SelectTea ||
        'Table'[TransferredToTeam] = _SelectTea ||
        'Table'[TransferredFromTeam] = _SelectTea
    )
)

 

Here is the result.

 

vnuocmsft_1-1723188621554.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Ritaf1983
Super User
Super User

Hi @PantherusNZ 

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors