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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Billgates
Frequent Visitor

Dynamic Custom Fiscal Year

Fact Table - Column 1, Date of Occurence

Date Dimension Table - Date, Calendar Year, Fiscal Year, Fiscal Period, Fiscal Week

I've to write a DAX measure that counts Column 1 where the Date of Occurence is in the last Fiscal Year. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Billgates ,

Based on my testing, please try the following methods again:

1.Create the simple tables.

vjiewumsft_0-1718086186540.png

vjiewumsft_1-1718086199160.png

2.Create the relationship between the two tables.

3.Create the new measure to calculate the last fiscal year counts.

CountLastFiscalYear = 
VAR CurrentFiscalYear = MAX('Table'[Fiscal year]) - 1
RETURN
CALCULATE(
    COUNTROWS('Fact Table'),
    FILTER(
        'Table',
        'Table'[Fiscal year] = CurrentFiscalYear
    )
)

4.The result is shown below.

vjiewumsft_2-1718086208535.png

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Billgates ,

Based on my testing, please try the following methods again:

1.Create the simple tables.

vjiewumsft_0-1718086186540.png

vjiewumsft_1-1718086199160.png

2.Create the relationship between the two tables.

3.Create the new measure to calculate the last fiscal year counts.

CountLastFiscalYear = 
VAR CurrentFiscalYear = MAX('Table'[Fiscal year]) - 1
RETURN
CALCULATE(
    COUNTROWS('Fact Table'),
    FILTER(
        'Table',
        'Table'[Fiscal year] = CurrentFiscalYear
    )
)

4.The result is shown below.

vjiewumsft_2-1718086208535.png

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ArtisanAmbrosia
Frequent Visitor

I find using the below linked table best for Fiscal Year reporting. The table has a Fiscal Year offset and various Fiscal Year fields when you input the month number of your first fiscal month. 

 

https://forum.enterprisedna.co/t/extended-date-table-power-query-m-function/6390

Thank you, I have my date table I just want a DAX measure to meet my requirements

Well, you may need to improve your date table...

 

With a relationship between 'Fact Table'[Date of Occurence] and 'Date'[Date] 
You could hardcode the measure, which isn't ideal for when next FY comes:
Last FY Count = CALCULATE(COUNT('Fact'[Column 1]), 'Date Table'[Fiscal Year] = "2023")

 

Or you could use variables for something like:
Last FY Count = VAR FYStart = [Date] >= "5/1/2023"

VAR FYEnd = [Date] <= "4/30/2024"

VAR CountFact = Count('Fact'[Column 1]

RETURN

CALCULATE(CountFact), [Date of Occurence] >= FYStart && [Date of Occurence] <= FYEnd)

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.