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
Unicorn_Tech
Resolver I
Resolver I

Elaborate IF statement

Hi.  I want to create an IF statement that will show:

If a company has duplicate products ordered, but the record was created on different days, enter the text "Resolve"

1 ACCEPTED SOLUTION

Hi @Unicorn_Tech,

 

Try this one, please.

Column =
VAR countRecords =
    CALCULATE (
        COUNTROWS ( 'table2' ),
        ALLEXCEPT (
            'table2',
            table2[new_licensee2],
            table2[First Variety],
            table2[new_quantity]
        )
    )
VAR ifSameCreateDate =
    CALCULATE (
        COUNTROWS ( 'Table2' ),
        ALLEXCEPT (
            Table2,
            Table2[new_licensee2],
            Table2[First Variety],
            Table2[new_quantity],
            Table2[Creation Date]
        )
    )
RETURN
    IF ( ifSameCreateDate > 1, "Fine", IF ( countRecords > 1, "Resolve", "Fine" ) )

Elaborate-IF-statement2

 

Best Regards,
Dale

Community Support Team _ Dale
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

6 REPLIES 6
PattemManohar
Community Champion
Community Champion

@Unicorn_Tech Please provide some sample data and expected output to suggest any accurate solution.




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

Proud to be a PBI Community Champion




Hi.  Thanks for replying:  Here is a table roughly of what I'm looking for:

 

new_licensee2First Country NameFirst Varietynew_quantityPlot CodeCreation DateResult 
Co . 1AlgeriaVar 1262.18J128/11/2018Fine 
Co . 2ChileVar 24J228/11/2018Fine 
Co . 3TunisiaVar 3228.43J328/11/2018ResolveHas 3 items that match:  new licensee, First Variety, New quantity, but creation date is different.  
Co . 1BrazilVar 12262.18J128/10/2018Fine 
Co . 2ChileVar 25J228/10/2018Fine 
Co . 3ChileVar 3228.43J328/10/2018ResolveHas 3 items that match:  new licensee, First Variety, New quantity, but creation date is different.  

Hi @Unicorn_Tech,

 

What should the result be if the [Creation Date] are the same? If this isn't an issue, please try this formula.

Column =
VAR countRecords =
    CALCULATE (
        COUNTROWS ( 'Table1' ),
        ALLEXCEPT (
            'Table1',
            Table1[new_licensee2],
            Table1[First Variety],
            Table1[new_quantity]
        )
    )
RETURN
    IF ( countRecords > 1, "Resolve", "Fine" )

Elaborate-IF-statement

 

Best Regards,
Dale

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

Hi.  Thank you for replying.  If Creation date is the same, I want it to write "Fine"

Hi @Unicorn_Tech,

 

Try this one, please.

Column =
VAR countRecords =
    CALCULATE (
        COUNTROWS ( 'table2' ),
        ALLEXCEPT (
            'table2',
            table2[new_licensee2],
            table2[First Variety],
            table2[new_quantity]
        )
    )
VAR ifSameCreateDate =
    CALCULATE (
        COUNTROWS ( 'Table2' ),
        ALLEXCEPT (
            Table2,
            Table2[new_licensee2],
            Table2[First Variety],
            Table2[new_quantity],
            Table2[Creation Date]
        )
    )
RETURN
    IF ( ifSameCreateDate > 1, "Fine", IF ( countRecords > 1, "Resolve", "Fine" ) )

Elaborate-IF-statement2

 

Best Regards,
Dale

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

THANK YOU!!!

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.