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
RayMe
Frequent Visitor

Help with finding duplicate incidents

Hi there

 

Hope someone out there can help with this problem 🙂 

 

I am looking for a way to add a condition that shows duplicate Incidents for a customer on the same day.

In general, the data is similar to what is in the table below.

 

DateCostomerIDIncidentIDIncidentIssue here
01/01/2022ID4444IA-01IncidentA<
01/01/2022ID4444IA-02IncidentA<
01/01/2022ID4444IA-03IncidentB 
02/01/2022ID4445IA-04IncidentA 
02/01/2022ID4445IA-05IncidentB 
03/01/2022ID4448IA-06IncidentA<
03/01/2022ID4449IA-07IncidentA<
03/01/2022ID4449IA-08IncidentA<
03/01/2022ID4449IA-09IncidentB 

 

There are multiple incidents per day, but they are never same.

I would like to see the date, customer, and incident information that has an issue.

I hope this makes sense.

2 ACCEPTED SOLUTIONS
danextian
Super User
Super User

Hi @RayMe ,

 

Try this  as a calculated column:

Incident Count > 1 =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[CostomerID] = EARLIER ( 'Table'[CostomerID] )
            && 'Table'[Date] = EARLIER ( 'Table'[Date] )
            && 'Table'[Incident] = EARLIER ( 'Table'[Incident] )
    )
) > 1
 

sample result:

danextian_0-1660826594574.png

Please note that one row for customer ID4448 on 3/Jan does not match your criteria of being a duplicate.

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

LucaixBolha
Resolver I
Resolver I

Hi @RayMe!

As far I've understood, your main criteria is to see all the information that also has an issue with it. If so, I'm thinking about a switch, where you could select "Has an issue", and filter only the ones that have it. I would do it this way:

1) Create a new table on power query, containing these info: 

LucaixBolha_3-1660827375462.png

 

2) After you create a measure for the value of the switch:

LucaixBolha_1-1660826967628.png

 

3) You create a measure for the information to be shown:
_If issue = if(

    'your table name'[column issue] = "<",
    'your table name'[column issue],
    BLANK() )

 

4) You create a measure for the switch itself:

LucaixBolha_2-1660827288899.png

 

5) You put in a slicer the first column "Has an Issue" of the first table that you've created (in step 1), in order to filter your data, and show only the rows that have an issue:

LucaixBolha_4-1660827678512.png

 

I think it should work 😄 

*If it works, please remember to mark me as a solution (and to give a kudo wouldn't be bad also hahaha) 😉




 

View solution in original post

4 REPLIES 4
LucaixBolha
Resolver I
Resolver I

Hi @RayMe!

As far I've understood, your main criteria is to see all the information that also has an issue with it. If so, I'm thinking about a switch, where you could select "Has an issue", and filter only the ones that have it. I would do it this way:

1) Create a new table on power query, containing these info: 

LucaixBolha_3-1660827375462.png

 

2) After you create a measure for the value of the switch:

LucaixBolha_1-1660826967628.png

 

3) You create a measure for the information to be shown:
_If issue = if(

    'your table name'[column issue] = "<",
    'your table name'[column issue],
    BLANK() )

 

4) You create a measure for the switch itself:

LucaixBolha_2-1660827288899.png

 

5) You put in a slicer the first column "Has an Issue" of the first table that you've created (in step 1), in order to filter your data, and show only the rows that have an issue:

LucaixBolha_4-1660827678512.png

 

I think it should work 😄 

*If it works, please remember to mark me as a solution (and to give a kudo wouldn't be bad also hahaha) 😉




 

danextian
Super User
Super User

Hi @RayMe ,

 

Try this  as a calculated column:

Incident Count > 1 =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[CostomerID] = EARLIER ( 'Table'[CostomerID] )
            && 'Table'[Date] = EARLIER ( 'Table'[Date] )
            && 'Table'[Incident] = EARLIER ( 'Table'[Incident] )
    )
) > 1
 

sample result:

danextian_0-1660826594574.png

Please note that one row for customer ID4448 on 3/Jan does not match your criteria of being a duplicate.

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Omg, it did exactly what I needed, thank you for the help

amitchandak
Super User
Super User

@RayMe , You can create a flag like

 

new column =

var _cnt = countx(filter(Table, [CostomerID] = earlier([CostomerID] && [date] =earlier([Date]) && [IncidentID] =earlier([IncidentID]) ) ,[IncidentID])

return

if(_cnt>1, 1, blank())

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.