Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I have a date table as below:
Start and end dates of the same month by Finalcial calendar can be different if years are different
How to calculate NSR LY , NSR MTD current month vs NSR MTD LY by Financial calendar in these cases?
Thanks,
Solved! Go to Solution.
Hi @LeHoaiDuy As I wrote, check Page 4 for Fiscal year data overview. On this tab there is Calendar Year (normal) and Fiscal Year in columns and there is SP measure.
Proud to be a Super User!
Hi bro, I need to calculate NSR by LY based on my financial calendar not how to create a new one table
Thanks,
Duy
Hi @LeHoaiDuy good if you have it. Please describe NSR by LY in more detail. LY is last year, what is NSR? Maybe I overlook something
Proud to be a Super User!
Hi bro,
NSR = Net Sales Revenue
For example: I have a Fact_sales table as below:
Please note that there may be a day without sales
I need to calculate NSR LY and MTD NSR of current month vs LY based on my financial calendar not Normal Calendar. SAMEPERIODLASTYEAR function will not work in this case because the start date of the financial calendar does not begin at the start of the month, and the end date does not align with month boundaries."
| Date | Customer | NSR |
| 1/1/2022 | AB | 15$ |
| 1/1/2022 | AC | 21$ |
| 2/1/2022 | AB | 12$ |
| 2/1/2022 | AC | 13$ |
| 2/1/2023 | AB | 15$ |
| 2/1/2023 | AC | 16$ |
Hi @LeHoaiDuy possible solution, create following calculated columns (Start_Fiscal_Year, End_Fiscal_Year,Fiscal_Year) into Calendar table and measures (NSR Measur, NSR YTD Measure, Total NSR, SPLY Fiscal NSR). Adjust Sheet21 to your table name
I used your and my dummy data, like data for customer XX
Did I answer your question? Kudos appreciated / accept solution!
Proud to be a Super User!
I may do not get your solution. Ragarding Fiscal canlendar, EOM will not end at 28 or 29 of month, it can pull to next month, refer to March, June, September....
For full insight please see as below:
For now. I need to calculate Sales Revenue by:
Hopefully, bro can give me a solution for this one
Thanks,
Hi @LeHoaiDuy do you realy have Calendar / Date table according created in Power BI?
In proposed solution, end of February is end / start for Fiscal year. What is start / end your fiscal year?
Proud to be a Super User!
Hi bro, this date table is created by manually and only for reference. about date table on Power BI, i will upload by excel file & it will follow as fiscal calendar
Start date of fiscal year will be in 1 of Jan
End date of fiscal year will be in 31 of Dec
And NSR by month must follow fiscal month not normal month
Thanks,
Duy
Hi @LeHoaiDuy year from 01.01.-31.12. is normal / defaul year so in your case fiscal year is the same as normal year?
If yes, what do you need to calculate? Simple SAMEPERIOD last year or ?
Proud to be a Super User!
Hi bro, i used to use this function to calculate but it does not work. Please see below
Because fiscal month is non standard
Hi @LeHoaiDuy for SAMEPERIODLASTYEAR to work properly, column/s for Date (year, monhs...) on visual should come from Calendar table, not fact table. Try it, if not already.
Proud to be a Super User!
Hi, column year_monh i take it from date date table
Hi @LeHoaiDuy for next steps, please share file.
Proud to be a Super User!
Hi @LeHoaiDuy please check file v2.
On tab Page3 there is simple YTD, same period last year output
On tab Page4 there is fiscal year data with measures as I wrote earlier above.
Please check it and provide feedback.
Output
Proud to be a Super User!
Hi bro,
Thanks for your solution, but
With date column in the table of page 3, I need to show data based on Fiscal Year & Fiscal Month not Normal Year_Month as you are using
In case, I use Fiscal Year & Fiscal Month for date column then data will show incorrrectly
Thanks,
Duy
Hi @LeHoaiDuy As I wrote, check Page 4 for Fiscal year data overview. On this tab there is Calendar Year (normal) and Fiscal Year in columns and there is SP measure.
Proud to be a Super User!
Hi @LeHoaiDuy I will check and let you know.
Proud to be a Super User!
Hi bro, best thanks for your solution, the result is as my expactation
Additionally, could you help me with one more measure. How to calculate MTD vs MTD LY?
Exp: Current fiscal month is just to 18 Oct 2023. So, MTD LY should only compare NSR from beginning of Oct 2022 to 18 Oct 2022
Thanks,
Hi @LeHoaiDuy
check link by our top solution author @amitchandak
Did I answer your question? Kudos appreciated / accept solution!
Proud to be a Super User!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.