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
Anonymous
Not applicable

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
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

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.
amitchandak
Super User
Super User

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

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.