Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
GA1993
Helper II
Helper II

Data rolling over to next year if status not completed

Hi,

 

I would like to display the Rate values as displayed on the Expectation tables where December 20 2022 rolls over as status was not completed. My code, however, displays the table with the Actual results below.

 

Weirdly, data rolls over if it is on the same year (eg below November to December) but it doesn't for December 2022 to January 2023.

 

Expectation:

DateTarget CompletionKPIRate
22-NovDecember 15 20221100%
22-NovDecember 15 20221 
22-NovDecember 20 2022    1 
22-DecDecember 20 2022050%
22-DecJanuary 21 20221 
23-JanDecember 20 202200%

 

Actual:

DateTarget CompletionKPIRate
22-NovDecember 15 20221100%
22-NovDecember 15 20221 
22-NovDecember 20 2022    1 
22-DecDecember 20 2022050%
22-DecJanuary 21 20221 
23-Janblank1100%

 

 

 

 

 

CALCULATE 
  (
   COUNTROWS('MP005 (Time to Hire)'),
   FILTER('MP005 (Time to Hire)',
   'MP005 (Time to Hire)'[Target Completion]>='MP - Engine'[Date]
    && 'MP005 (Time to Hire)'[Target Completion]<=EOMONTH('MP - Engine'[Date],0)
    && 'MP005 (Time to Hire)'[KPI]=1)                
   )
/ (
(CALCULATE
  (
   COUNTROWS('MP005 (Time to Hire)'),
    FILTER('MP005 (Time to Hire)',
    'MP005 (Time to Hire)'[Target Completion]>='MP - Engine'[Date]
     && 'MP005 (Time to Hire)'[Target Completion]<=EOMONTH('MP - Engine'[Date],0)
     && 'MP005 (Time to Hire)'[KPI]=1)                                    
   )
) + 
(CALCULATE
 (
    COUNTROWS('MP005 (Time to Hire)'),
    FILTER('MP005 (Time to Hire)',
    'MP005 (Time to Hire)'[Target Completion]>='MP - Engine'[Date]
     && 'MP005 (Time to Hire)'[Target Completion]<=EOMONTH('MP - Engine'[Date],0)
     && 'MP005 (Time to Hire)'[KPI]=0)                                    
 )
)   
)

 

 

 

 

 

Can someone help me please? Thanks in advance!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @GA1993,

I think the EOMonth function may not suitable for the cross year calculation, you can try to use the following dax formula if it helps:

 

formula =
CALCULATE (
    DIVIDE (
        CALCULATE (
            COUNTROWS ( 'MP005 (Time to Hire)' ),
            'MP005 (Time to Hire)'[KPI] = 1
        ),
        CALCULATE (
            COUNTROWS ( 'MP005 (Time to Hire)' ),
            'MP005 (Time to Hire)'[KPI] IN { 0, 1 }
        )
    ),
    FILTER (
        'MP005 (Time to Hire)',
        'MP005 (Time to Hire)'[Target Completion] >= 'MP - Engine'[Date]
            && 'MP005 (Time to Hire)'[Target Completion]
                <= DATE ( YEAR ( 'MP - Engine'[Date] ), MONTH ( 'MP - Engine'[Date] ) + 1, 1 ) - 1
    )
)

 

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @GA1993,

I think the EOMonth function may not suitable for the cross year calculation, you can try to use the following dax formula if it helps:

 

formula =
CALCULATE (
    DIVIDE (
        CALCULATE (
            COUNTROWS ( 'MP005 (Time to Hire)' ),
            'MP005 (Time to Hire)'[KPI] = 1
        ),
        CALCULATE (
            COUNTROWS ( 'MP005 (Time to Hire)' ),
            'MP005 (Time to Hire)'[KPI] IN { 0, 1 }
        )
    ),
    FILTER (
        'MP005 (Time to Hire)',
        'MP005 (Time to Hire)'[Target Completion] >= 'MP - Engine'[Date]
            && 'MP005 (Time to Hire)'[Target Completion]
                <= DATE ( YEAR ( 'MP - Engine'[Date] ), MONTH ( 'MP - Engine'[Date] ) + 1, 1 ) - 1
    )
)

 

Regards,

Xiaoxin Sheng

Thanks for the reply.

 

I wanted to know more about your code what does the following mean?

MONTH ( 'MP - Engine'[Date] ) + 1, 1 ) - 1

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.