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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Dynamic Calculation based on FY Date

Hi,

 

I have this table and want to compute the following:

 

1. Sum of SIO based on  FY YTD = Jul 2022 up to Nov 2022 (Month Year)

Month Year is dynamic. Since today is December, latest Month Year is November. If we move to next month FY YTD is July 2022 to Dec 2022 so the formula should be able to adjust based on that.

 

2. Sum of SIO based on Previous FY = Jul 2021 to Jun 2022. 

The formula should only sum from Jul 2021 to Jun 2022. This will move to Jul 2022 to Jun 2023 if month of today date is Jul 2023. 

 

jdalfonso_0-1670931591194.png

 

I already have time intelligence in my data fields

 

jdalfonso_1-1670931907284.png

 

 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

To compute the sum of SIO based on FY YTD and Previous FY in PowerBI, you can use the SUMX and CALCULATE functions.

1 To compute the sum of SIO based on FY YTD, you can use the following formula:

FY YTD =
SUMX (
    FILTER (
        table,
        table[Month Year] >= DATE ( YEAR ( TODAY () ), 7, 1 )
            && table[Month Year] <= MAX ( table[Month Year] )
    ),
    table[SIO]
)

This formula uses the SUMX function to sum the values in the SIO column for all rows in the table where the Month Year column is greater than or equal to July 1 of the current year and less than or equal to the maximum value in the Month Year column.

2 To compute the sum of SIO based on the previous FY, you can use the following formula:

Previous FY =
CALCULATE (
    SUM ( table[SIO] ),
    DATESBETWEEN (
        table[Month Year],
        DATE ( YEAR ( TODAY () ) - 1, 7, 1 ),
        DATE ( YEAR ( TODAY () ), 6, 30 )
    )
)

This formula uses the CALCULATE function to sum the values in the SIO column for all rows in the table where the Month Year column is between July 1 of the previous year and June 30 of the current year.

You can then add these calculated columns to your PowerBI report to display the FY YTD and Previous FY sums.


If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.


Best Regards,
Henry


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

1 REPLY 1
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

To compute the sum of SIO based on FY YTD and Previous FY in PowerBI, you can use the SUMX and CALCULATE functions.

1 To compute the sum of SIO based on FY YTD, you can use the following formula:

FY YTD =
SUMX (
    FILTER (
        table,
        table[Month Year] >= DATE ( YEAR ( TODAY () ), 7, 1 )
            && table[Month Year] <= MAX ( table[Month Year] )
    ),
    table[SIO]
)

This formula uses the SUMX function to sum the values in the SIO column for all rows in the table where the Month Year column is greater than or equal to July 1 of the current year and less than or equal to the maximum value in the Month Year column.

2 To compute the sum of SIO based on the previous FY, you can use the following formula:

Previous FY =
CALCULATE (
    SUM ( table[SIO] ),
    DATESBETWEEN (
        table[Month Year],
        DATE ( YEAR ( TODAY () ) - 1, 7, 1 ),
        DATE ( YEAR ( TODAY () ), 6, 30 )
    )
)

This formula uses the CALCULATE function to sum the values in the SIO column for all rows in the table where the Month Year column is between July 1 of the previous year and June 30 of the current year.

You can then add these calculated columns to your PowerBI report to display the FY YTD and Previous FY sums.


If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.


Best Regards,
Henry


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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.