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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
spaxia
Helper I
Helper I

Custom Fiscal Year Calendar Issue

Hello,

I have a little issue.

I have a Canvass Table to define some custom Periods, the Columns are:

CanvassID  int
CanvassName String
FromDate Date
ToDate  Date
FiscalYear String


I created a Measure Named Current FY

Current FY =
CALCULATE (
    DISTINCT ( Canvass[FiscalYear] );
    FILTER (
        Canvass;
        (
            Canvass[FromDate]
                <= ( DATE ( YEAR ( NOW () ); MONTH ( NOW () ); DAY ( NOW () ) ) )
                && (
                    DATE ( YEAR ( NOW () ); MONTH ( NOW () ); DAY ( NOW () ) )
                        <= ( Canvass[ToDate] )
                )
        )
    )
)

If I place in the chart Area it correctly print FY 16/17 now I want to calculate the FY Actuals from a Table of Values

JC FY Actuals =
CALCULATE (
    SUM ( 'Canvass Budget Actuals'[JCActuals] );
    FILTER (
        'Canvass Budget Actuals';
        [CanvassID]
            = CALCULATE (
                DISTINCT ( Canvass[CanvassID] );
                FILTER ( Canvass; Canvass[FiscalYear] = [Current FY] )
            )
    )
)

The above measure doesn't work as expected, I get the correct results only if i Change [Current FY] with the string "16/17".

 

Any help?

1 ACCEPTED SOLUTION
Eric_Zhang
Microsoft Employee
Microsoft Employee


@spaxia wrote:

Hello,

I have a little issue.

I have a Canvass Table to define some custom Periods, the Columns are:

CanvassID  int
CanvassName String
FromDate Date
ToDate  Date
FiscalYear String


I created a Measure Named Current FY

Current FY =
CALCULATE (
    DISTINCT ( Canvass[FiscalYear] );
    FILTER (
        Canvass;
        (
            Canvass[FromDate]
                <= ( DATE ( YEAR ( NOW () ); MONTH ( NOW () ); DAY ( NOW () ) ) )
                && (
                    DATE ( YEAR ( NOW () ); MONTH ( NOW () ); DAY ( NOW () ) )
                        <= ( Canvass[ToDate] )
                )
        )
    )
)

If I place in the chart Area it correctly print FY 16/17 now I want to calculate the FY Actuals from a Table of Values

JC FY Actuals =
CALCULATE (
    SUM ( 'Canvass Budget Actuals'[JCActuals] );
    FILTER (
        'Canvass Budget Actuals';
        [CanvassID]
            = CALCULATE (
                DISTINCT ( Canvass[CanvassID] );
                FILTER ( Canvass; Canvass[FiscalYear] = [Current FY] )
            )
    )
)

The above measure doesn't work as expected, I get the correct results only if i Change [Current FY] with the string "16/17".

 

Any help?


@spaxia

I'd doubt it is a filter context issue. What's going on if you put measure [Current FY] as a  table column. To got the correct result, try

Current FY = 
CALCULATE (
DISTINCT ( Canvass[FiscalYear] ),
FILTER (
ALL(Canvass),
(
Canvass[FromDate]
<=DATEVALUE(TODAY())
&& (
DATEVALUE(TODAY())
<= ( Canvass[ToDate] )
)
)
)
)

 

For more specific suggestion, please post some sample(in plain text or a uploaded file link) data and expected output. 

View solution in original post

1 REPLY 1
Eric_Zhang
Microsoft Employee
Microsoft Employee


@spaxia wrote:

Hello,

I have a little issue.

I have a Canvass Table to define some custom Periods, the Columns are:

CanvassID  int
CanvassName String
FromDate Date
ToDate  Date
FiscalYear String


I created a Measure Named Current FY

Current FY =
CALCULATE (
    DISTINCT ( Canvass[FiscalYear] );
    FILTER (
        Canvass;
        (
            Canvass[FromDate]
                <= ( DATE ( YEAR ( NOW () ); MONTH ( NOW () ); DAY ( NOW () ) ) )
                && (
                    DATE ( YEAR ( NOW () ); MONTH ( NOW () ); DAY ( NOW () ) )
                        <= ( Canvass[ToDate] )
                )
        )
    )
)

If I place in the chart Area it correctly print FY 16/17 now I want to calculate the FY Actuals from a Table of Values

JC FY Actuals =
CALCULATE (
    SUM ( 'Canvass Budget Actuals'[JCActuals] );
    FILTER (
        'Canvass Budget Actuals';
        [CanvassID]
            = CALCULATE (
                DISTINCT ( Canvass[CanvassID] );
                FILTER ( Canvass; Canvass[FiscalYear] = [Current FY] )
            )
    )
)

The above measure doesn't work as expected, I get the correct results only if i Change [Current FY] with the string "16/17".

 

Any help?


@spaxia

I'd doubt it is a filter context issue. What's going on if you put measure [Current FY] as a  table column. To got the correct result, try

Current FY = 
CALCULATE (
DISTINCT ( Canvass[FiscalYear] ),
FILTER (
ALL(Canvass),
(
Canvass[FromDate]
<=DATEVALUE(TODAY())
&& (
DATEVALUE(TODAY())
<= ( Canvass[ToDate] )
)
)
)
)

 

For more specific suggestion, please post some sample(in plain text or a uploaded file link) data and expected output. 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors