Forum Discussion
Calculate Difference Between Dates in the same Column and the %
Hi
Thanks for the link, I used the formula below:
Right, looking at the code the problem here is that the fiscal year is of the data type text because it contains a hyphen.
The easiest solution would be either replace your current fiscal year column or create a duplicate fiscal year column and than remove the hyphen and change the datatype to a whole number.
In the power query you could just duplicate the column, replace the hyphen with nothing and than convert it to whole number.
Or you could create a custom column and use the following dax code
Column = SUBSTITUTE(Table[YearColumn],"-","")
Just replace the table & column with your own and format it as a whole number under the modeling tab. Then use this new column in the code and it should work.
- Anonymous7 years agoNot applicable
Hi
Thanks for your reply. The variance DAX works now, but Variance % is not:
Sales_Var% = DIVIDE('Data'[_Sales Variance],CALCULATE(sum(Data[Sales_value £k]),FILTER(ALL(Data[FiscalYearNew]=201718)))Too few arguments were passed to the filter function. The mimimum argument count for the function is 2.Any help is greatly appreciated.- Anonymous7 years agoNot applicable
Spoke too soon, the variance doesn't work, the value in the variance column is exactly the same as the Sales column.
Please help!!!