Date.FiscalMonth

DAXAno fiscal

Mês fiscal da data (1 = mês de início do ano fiscal).

Sintaxe

DAX
Date.FiscalMonth ( pDate, pStartMonth )

Parâmetros

pDateDATETIME VALObrigatório

Data.

DAX
DATE ( 2025, 8, 1 )
pStartMonthINT64 VALObrigatório

Mês de início do ano fiscal (1 a 12).

DAX
7

Tipo de retorno

Número inteiro

Exemplos

DAX
EVALUATE { Date.FiscalMonth ( DATE ( 2025, 8, 1 ), 7 ) }
// 2

Código completo

DAX
DEFINE
    /// Mês fiscal da data (1 = mês de início do ano fiscal).
    /// @param {DATETIME} pDate - Data.
    /// @param {INT64} pStartMonth - Mês de início do ano fiscal (1 a 12).
    /// @returns Mês fiscal, de 1 a 12.
    FUNCTION Date.FiscalMonth =
        ( pDate : DATETIME VAL, pStartMonth : INT64 VAL ) =>
        MOD ( MONTH ( pDate ) - pStartMonth + 12, 12 ) + 1

EVALUATE
{ Date.FiscalMonth ( DATE ( 2025, 8, 1 ), 7 ) }  // 2

Mais informações

Fonte
Paulo André Jesus — OfficeTuning
Versão
1.1.0

Conhecer a trilha Power BI ao vivo