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.

Selected Value for a Date Column does not Work with Other Formula

Hello everyone,

 

This is an issue of SELECTEDVALUE vs Hardcoding. The former doesn't work, and the latter does in a calculated column.

 

We're getting a pecular issue when calculating a column for "Inventory Aging". Our goal is to have the user to select a Date, and the calculated column would get the difference between the selected date and the "Creation Date" of the inventory item. Hence, it's Selected Date - Inventory Created Date which would give you the difference in days.

 

When we hard code the date into "Selected Date" using the DATE(Year, Month, Day) function, it works perfectly. However, when we use the SELECTEDVALUE function to extract the date selected by the user, it returns wild negative numbers. I double-checked that the hardcoded Date and the Selected Value date are perfectly identical, but the selected value doesn't work. 

 

Is there some weird interaction or hidden values when SELECTEDVALUE runs against a Date column? SLECETEDVALUE is only supposed to return one value - and if I have checked that it is indeed the correct date on a separate card, why does it behave so erratically in a calculated column in a table visual?

 

Any help or insight would be appreciated - thanks!

Status: New
Comments
v-chuncz-msft
Community Support

@NumanPiik 

 

Values in a calculated column are fixed. They are an immutable result for each row in the table. You'll need to create a measure.