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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.