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

Help changing months

I have been using the below formula to calculate my fired employees but it is offsetting it by a month. Can anyone help me shift it properly so that it display on the month they were fired rather than the month after? 

(August should show 8 and September should show 3)

 
 
 

image.png

Fired = 
VAR currDate =
    MAX ( Sheet1[Date] )
VAR currList =
    CALCULATETABLE (
        VALUES ( Sheet1[EmployeeID] ),
        FILTER (
            ALLSELECTED ( Sheet1 ),
            [Date] >= DATE ( YEAR ( currDate ), MONTH ( currDate ), 1 )
                && [Date]
                    <= DATE ( YEAR ( currDate ), MONTH ( currDate ) + 1, 1 )
                        - 1
        )
    )
VAR prevList =
    CALCULATETABLE (
        VALUES ( Sheet1[EmployeeID] ),
        FILTER (
            ALLSELECTED ( Sheet1 ),
            [Date]
                >= DATE ( YEAR ( currDate ), MONTH ( currDate ) - 1, 1 )
                && [Date]
                    <= DATE ( YEAR ( currDate ), MONTH ( currDate ), 1 ) - 1
        )
    )
RETURN
    COUNTROWS ( EXCEPT ( prevList, currList ) )
        + IF ( DISTINCTCOUNT ( Sheet1[EmployeeID] ) <> 0, 0, BLANK () ) 

 

2 REPLIES 2
amitchandak Super Contributor
Super Contributor

Re: Help changing months

If possible please share a sample pbix file after removing sensitive information.
Thanks

Community Support Team
Community Support Team

Re: Help changing months

Hi @shellmer ,

 

Could you please share your sample data and excepted result to me if you don't have any confidential Information. Please upload your files to One Drive and share the link here.

 

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

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (4,750)