So the issue that we are running into deals with calculating YTD properly when some business units are on a different fiscal year. Some business units are Calendar Year and others are Fiscal Year (year end of 6/30). What we did for the setup is as follows:
We created a “Year End” column in the Business Unit dimension table. This denotes either a year end of 6/30 or a year end of 12/31. Next, in our fact data table (Profit and Loss) I created a LOOKUPVALUE column that looks up the value (6/30 or 12/31 from the
Business Unit dimension table) and another column called YearEndSwitch (either a 1 or a 2 based on 6/30 or 12/31). I cannot use this Switch in an IF statement, so I created a hidden YearEndSwitchMeasure that uses the AVERAGE calculation to give me either a
1 or a 2 in an IF statement.
Example:
Dollars Actual YTD:=if([YearEndSwitchMeasure]=1, TOTALYTD([Dollars Actual], 'Time'[ApplyDate], "06/30"), TOTALYTD([Dollars Actual], 'Time'[ApplyDate], "12/31"))
The issue here is that I will only get a YearEndSwitchMeasure value of 1 or a 2 *if* there is an actual row value present. So for example, if we have a Dollar amount in a certain account for a certain business unit for January, the YearEndSwitchMeasure will
assign a 1 or a 2 based on Year End. But if there is no value for February, TOTALYTD will not calculate correct because the IF statement cannot determine if it is a 1 or a 2 (because it is actually a BLANK!)
We are trying to avoid having to use two separate YTD Measures based on 6/30 or 12/31 Year End. We would like to use a single YTD measure, but this seems difficult since we cannot get a switch to work to automatically determine which one a business unit is
using.
We have tried using LOOKUPVALUE but that does not work in the context of a measure.
Thanks in advance!
Rich