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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
s-turn
Resolver I
Resolver I

Calculating change from previous row of matrix/YOY partial years

Hello, 

The below visualisation comes from a transaction dataset of orders, joined to a custom date table "tbl_FYCalendar" which provides fields for fiscal year and fiscal month index, as well as calendar years and months.

I was tasked with calculating the raw and & change YOY for each Department's number of orders.

I did this successfully to begin with - I created a Matrix visual, and used measures like 

LastFYOrders = CALCULATE([#Orders],PREVIOUSYEAR(tbl_FYCalendar[Date],"03/31"))
(which I realise kind of duplicates what the custom calendar is meant to do - I couldn't figure out how to get the measure to refer to the fiscal year dynamically).
and then
%OrdersChangeYOY = IF(NOT(ISBLANK([LastFYOrders])),([#Orders]/[LastFYOrders])-1)
(again, I know the "if(not(isblank)))" bit isn't very elegant either - I couldnt' work out how else to stop it trying to calculate the change from nothing to FY18-19.
 
I then realised that I wasn't comparing like with like, as we only have data up until the end of October for the latest fiscal year.
 

Therefore, I applied a filter to the visual, on calendar month - so that only orders from April to October in each fiscal year were to be included.

 

And I got this:

 

As you can see, the Orders Change and % Orders Change columns are not correct - they are referring to the full previous year's totals, not just the April-Oct versions.

 

I can see why, but I am stuck on how to fix it.

 

Any ideas much appreciated - thanks in advance.

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi @s-turn ,

 

Is your issue solved now?If not,could you pls upload your .pbix file with expected output to Onedrive business and share the link with us?

Remember to remove the confidential information.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

s-turn
Resolver I
Resolver I

YOY to upload to help forum.PNG

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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