cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Was this the last payroll transaction this month

Struggling with this one. I have a dataset of transactions that occur either weekly or fortnightly, some manual and some auto, with different types on different phases. I'm trying to flag true/false of the transaction is the last auto transaction for that group for that month:

 

Paygroup          Type           Date        True/False

P1F                 Auto         03/09/17        False

P1F                 Auto         17/09/17        True

P1F                 Manual     17/09/17        False

P1W                Auto         03/09/17       False

P1W                Auto         10/09/17       False

P1W                Auto         17/09/17       False

P1W                Auto         24/09/17       True

P1M                Auto         15/09/17        True

P2F                 Auto         10/10/17        False

P2F                 Auto         24/10/17        True

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Was this the last payroll transaction this month

@gary_connolly,

 

You may refer to the following DAX that adds a calculated column.

Column =
Table1[Type] = "Auto"
    && RANKX (
        FILTER (
            Table1,
            Table1[Paygroup] = EARLIER ( Table1[Paygroup] )
                && Table1[Type] = EARLIER ( Table1[Type] )
                && YEAR ( Table1[Date] ) = YEAR ( EARLIER ( Table1[Date] ) )
                && MONTH ( Table1[Date] ) = MONTH ( EARLIER ( Table1[Date] ) )
        ),
        Table1[Date],
        ,
        DESC,
        DENSE
    )
        = 1
Community Support Team _ Sam Zha
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

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Was this the last payroll transaction this month

@gary_connolly,

 

You may refer to the following DAX that adds a calculated column.

Column =
Table1[Type] = "Auto"
    && RANKX (
        FILTER (
            Table1,
            Table1[Paygroup] = EARLIER ( Table1[Paygroup] )
                && Table1[Type] = EARLIER ( Table1[Type] )
                && YEAR ( Table1[Date] ) = YEAR ( EARLIER ( Table1[Date] ) )
                && MONTH ( Table1[Date] ) = MONTH ( EARLIER ( Table1[Date] ) )
        ),
        Table1[Date],
        ,
        DESC,
        DENSE
    )
        = 1
Community Support Team _ Sam Zha
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

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors