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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
GC26
New Member

Count rows in current financial year and compare to same time in previous financial year

Hi,

 

I am relatively new to PowerBi and I have been looking to practice on some example data.

 

My aim is to count the number of rows in my dataset (Based on number of fires and there is 1 fire per row) in the current financial year to date and the same time in the previous financial year (FY runs from 1/4 to 31/3).

 

I have come across a previous chat which I have replicated the solution from in my own dataset successfully. However this was designed for calendar year and I would like to ammend it for financial year.

 

Any help on how to do this based on the below DAX would be greatly appreciated.

 

Total Sales =

CALCULATE(SUM(Data[Sales]))

YTD prods =

CALCULATE (

    [Total Sales],

    FILTER (

        'Calendar',

        'Calendar'[Year] = YEAR ( TODAY () )

            && 'Calendar'[Date] <= TODAY ()

    )

)

LY YTD Sales =

CALCULATE (

    [Total Sales],

    FILTER (

        'Calendar',

        'Calendar'[Year]

            = YEAR ( TODAY () ) - 1

            && 'Calendar'[Date]

                <= EOMONTH ( TODAY (), -13 ) + DAY ( TODAY () )

    )

)

Difference% =

DIVIDE([YTD prods] - [LY YTD Sales],[LY YTD Sales])

0 REPLIES 0

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.