Forum Discussion

mromberg's avatar
mromberg
Frequent Visitor
4 years ago
Solved

Flagging New Accounts Based on Prior Ordering

Failry new user to PowerBI and need help with a calculation.  I'm trying to flag new accounts for the current quarter.  First qualfiier is order in Current Quarter>0.  Second qualifier is no orders I...
  • v-xiaotang's avatar
    4 years ago

    Hi mromberg 

    Try this, and please check the sample file attached below

    Column = 
    VAR _isnew =
        IF (
            CALCULATE (
                COUNTROWS ( 'Table' ),
                FILTER (
                    'Table',
                    'Table'[Account #] = EARLIER ( 'Table'[Account #] )
                        && 'Table'[Territory] = EARLIER ( 'Table'[Territory] )
                        && 'Table'[Time Period] = "Prior Quarter"
                )
            ) > 0,
            "N",
            "Y"
        )
    RETURN
        IF ( 'Table'[Time Period] = "Current Quarter", _isnew, BLANK () )

    Best Regards,

    Community Support Team _Tang

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