Forum Discussion
DAX issue with Value Type
Anonymous,
The data type of [PY FW] and [CY FW] measures are whole number, right? If so, why not directly use the following DAX? VALUE() function is used to convert a text string that represents a number to a number.
_Value YTD Previous:=IF([_Value All Period]>0,
CALCULATE([_Value All Period],
FILTER('Calendar','Calendar'[YearFiscalWeek]<=[PY FW]),'Calendar'[YearFiscalWeek]>=201701),
BLANK())
Regards,
Lydia
Hi Lydia,
Thanks for the response.
Yes correct, they are both whole numbers. Sorry my mistake, I did try with and without value (I only tried with VALUE when initially it did not work without Value. so I did actually start by using the formula you suggested:
_Value YTD Previous:=IF([_Value All Period]>0,
CALCULATE([_Value All Period],
FILTER('Calendar','Calendar'[YearFiscalWeek]<=[PY FW]),'Calendar'[YearFiscalWeek]>=201701),
BLANK())
The strange thing is, in my YTD measure, [CY FW] is being used and works fine, however when I refer to [PY FW] (which is [CY FW]-100, the correct figure shows in the measure for [PY FW] but it does not give me any value for the YTD previous unless I manually type in the [PY FW] as the actual number!
- Anonymous8 years agoNot applicable
Anonymous,
Could you please share dummy data of the tables so that I can test?
Regards,
Lydia