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
michael_knight
Post Prodigy
Post Prodigy

Duplicate detection, return a value

Hi,

 

I'm trying to create a column which will display an outcome depending on the results of the duplicate detection

 

PBI.PNG

This is sample data that I'm working with

 

Outcome.PNG

This is the outcome I want.

The first thing I look at is if Address, Status and Company are all the same. After looking at that we will then look at the Agent, if there is multiple Agents for the same Address then we will display "Half". If there is one or more Address that have the same Agent then we will display "Full"

 

PBIOutcome.PNG

This is the outcome I got from Power BI. I did a simple Concatenate for the Conc column the merge the columns and then used this DAX formula to return the "Half" or "Full"

Half/Full Appointment = 
Var Appoint = 'Table'[Conc]

var AppCount = 
 CALCULATE(
    COUNTROWS('Table'),
    all('Table'),
    'Table'[Conc] = Appoint
)

return

IF(AppCount <= 1, "Full", "Half") 

 

Does anyone know how to get the outcome that I'm looking for?

 

PBI File: https://www.dropbox.com/s/40kthwjmdwufm7l/Appoint.pbix?dl=0

 
Let me know if you've got any questions
 

Cheers,

Mike

1 ACCEPTED SOLUTION
mahoneypat
Employee
Employee

Please try this column expression to get your result.

 

HalfFull =
VAR agentcount =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Agent] ),
        ALLEXCEPT ( 'Table', 'Table'[Address], 'Table'[Status], 'Table'[Company] )
    )
RETURN
    IF ( agentcount = 1"Full""Half" )

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Employee
Employee

Please try this column expression to get your result.

 

HalfFull =
VAR agentcount =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Agent] ),
        ALLEXCEPT ( 'Table', 'Table'[Address], 'Table'[Status], 'Table'[Company] )
    )
RETURN
    IF ( agentcount = 1"Full""Half" )

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thank you, Pat!

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.