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
nikhilrai
New Member

Issues Understanding Time Intelligence Functions in Power BI

I recently read this blog on Time Intelligence Functions in Power BI that enhanced my understanding, but I still have some questions.

While using functions like TOTALYTD, SAMEPERIODLASTYEAR, and DATEADD, I’ve found that the results sometimes don’t match my expectations, particularly with incomplete months or fiscal years.

For example, my fiscal year begins in April instead of January. How can I accurately apply these functions to reflect this in Year-to-Date (YTD) calculations and year-over-year comparisons? Should I adjust my calendar table, or is there a way to modify the functions directly?

Any insights!

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@nikhilrai Create a calendar table that includes a column for the fiscal year and fiscal month. This table should have a continuous range of dates and additional columns to represent fiscal periods.

 

When using functions like TOTALYTD, you can specify the fiscal year start month. For example, to calculate the Year-to-Date (YTD) total starting from April, you can use the TOTALYTD function with the year_end_date parameter set to March 31st.

 

DAX
Calendar =
ADDCOLUMNS (
CALENDAR (DATE(2020, 1, 1), DATE(2023, 12, 31)),
"Year", YEAR([Date]),
"Month", MONTH([Date]),
"Day", DAY([Date]),
"Fiscal Year", IF(MONTH([Date]) >= 4, YEAR([Date]), YEAR([Date]) - 1),
"Fiscal Month", IF(MONTH([Date]) >= 4, MONTH([Date]) - 3, MONTH([Date]) + 9)
)

YTD_Sales =
TOTALYTD (
[Total Sales],
'Calendar'[Date],
"03/31"
)

 

For year-over-year comparisons, you can use the SAMEPERIODLASTYEAR function in conjunction with your adjusted calendar table. Ensure that your measures reference the fiscal year columns appropriately.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

4 REPLIES 4
v-tsaipranay
Community Support
Community Support

Hi @nikhilrai ,

Thanks for reaching out to the Microsoft fabric community forum.

 

As @bhanu_gautam mentioned in his post, could you confirm whether it resolved your issue? Please feel free to reach out if you have any further questions. If the response addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

 

Thank you.

Hi @nikhilrai ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

Hi @nikhilrai ,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

 

bhanu_gautam
Super User
Super User

@nikhilrai Create a calendar table that includes a column for the fiscal year and fiscal month. This table should have a continuous range of dates and additional columns to represent fiscal periods.

 

When using functions like TOTALYTD, you can specify the fiscal year start month. For example, to calculate the Year-to-Date (YTD) total starting from April, you can use the TOTALYTD function with the year_end_date parameter set to March 31st.

 

DAX
Calendar =
ADDCOLUMNS (
CALENDAR (DATE(2020, 1, 1), DATE(2023, 12, 31)),
"Year", YEAR([Date]),
"Month", MONTH([Date]),
"Day", DAY([Date]),
"Fiscal Year", IF(MONTH([Date]) >= 4, YEAR([Date]), YEAR([Date]) - 1),
"Fiscal Month", IF(MONTH([Date]) >= 4, MONTH([Date]) - 3, MONTH([Date]) + 9)
)

YTD_Sales =
TOTALYTD (
[Total Sales],
'Calendar'[Date],
"03/31"
)

 

For year-over-year comparisons, you can use the SAMEPERIODLASTYEAR function in conjunction with your adjusted calendar table. Ensure that your measures reference the fiscal year columns appropriately.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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.