# DAX measure to count months in current FY

Good day all

Need some guidance on a measure i need to create. i need to calculate count of months in currently FY.

Fiscal Year = december to November

if we calculate amount of months december 2020 till today (10 & half month)

Hello @neilonbooysen,

Thank You for posting your query onto the Forum.

To achieve the results as per the condition that youâ€™ve specified. Below is the measure alongwith the screenshot of the final results - 1 provided for the reference -

``````Current Fiscal Months Calculation - 1 =
VAR _Month_Calculation =
DATEDIFF(
DATE( YEAR( TODAY() ) - 1 , 12 , 1 ) ,
TODAY() ,
MONTH )

VAR _Days_Calculation =
DATEDIFF(
DATE( YEAR( TODAY() ) , MONTH( TODAY() ) , 1 ) ,
TODAY() ,
DAY )

VAR _Condition =
SWITCH( TRUE() ,
_Days_Calculation > 20 && _Days_Calculation <= 31 , "1/3 Month Remaining" ,
_Days_Calculation > 10 && _Days_Calculation <= 20 , "1/2 Month" ,
_Days_Calculation < 10 , "2/3 Month Remaining" ,
0 )

VAR _Results =
_Month_Calculation & " &" & " " & _Condition

RETURN
_Results
``````

Alternatively, if you want analyze the results something like â€śMonths and Daysâ€ť you can create a measure like this. Below is the measure alongwith the screenshot of the final results - 2 provided for the reference -

``````Current Fiscal Months Calculation - 2 =
VAR _Month_Calculation =
DATEDIFF(
DATE( YEAR( TODAY() ) - 1 , 12 , 1 ) ,
TODAY() ,
MONTH )

VAR _Days_Calculation =
DATEDIFF(
DATE( YEAR( TODAY() ) , MONTH( TODAY() ) , 1 ) ,
TODAY() ,
DAY )

VAR _Results =
_Month_Calculation & " Months" & " &" & _Days_Calculation & " Days"

RETURN
_Results
``````

Iâ€™m also attaching the working of the PBIX file for the reference purposes.

Hoping you find this useful and meets your requirements that youâ€™ve been looking for.

Thanks and Warm Regards,
Harsh

Fiscal Months - Harsh.pbix (656.3 KB)

1 Like

thanks so much, this works perfectly

Hello @neilonbooysen,

Youâ€™re Welcome.

Iâ€™m glad to hear that it worked for you and you found it helpful.

Thanks and Warm Regards,
Harsh