I have a calculated Measure which is an output in Date format like 1/1/2017. Once I want to use this output in if condition I can not get the correct answer and "if condition" can not recognise it.I dont know how I may have both in the same format to compre them in a if conditon. my current if condition is as below: I expect that the below formulah return 1 once Measure=1/1/2017.however it doesnt recognise them as equal and return 0. any idea how I can fix it?
Can you please add 3 test columns to your table (to be deleted later)
My Year Col = YEAR([Measure]) My Month Col = MONTH([Measure]) My Day Col = DAY([Measure])
Just to see if these values are what you would expect
Proud to be a Datanaut!
@myti you mentioned it is a calculated measures which is date type?
What formula you are using for this calculated measures?
What is your data source?
What is data type of this new measure?
Also as @Phil_Seamark mentioned, create those fields to see what value you are getting?
Can you also try this following, assuming your locale setting for date is MM/DD/YYYY, just wondering if your measure is text type and following formula will convert date to text for comparison purpose.
Although there are many unknown, once we have reply on above question, it will help to resolve the issue.
I receive the value for calculated measure based on the below formula.It get the current value of page level filter which is based on the date format.
Measure = If ( HasOneValue('landing-pages'[ipg:month]) , Values ('landing-pages'[ipg:month]))
I tried your formulah but I recived error ("DAX comparison operations do not support comparing values of type Date with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.")
Hopefully my information is good enough to find a solution.