Friday, October 30, 2026

selectedvalue || HasOneValue || Values || CONCATENATEX

 SELECTEDVALUE : Displays the value that is selected. If multiple values are selected it displays blank

selectedvalue2 = SELECTEDVALUE(dim_date[Year])


HASONEVALUE = It returns true/false. Can be used inside IF function.


Say, we want to display the selected year and if multiple values are selected display them as concatenated values.

SelectedYear = IF
(HASONEVALUE(dim_date[Year]), SELECTEDVALUE(dim_date[Year]), CONCATENATEX(VALUES(dim_date[Year]), dim_date[Year], ","))


CONCATENATEX : displays all values inside the parameters  with delimiters that was specified.

If we observe we have used VALUES function as well.

VALUES : It returns single column with unique values.

If we don't use VALUES then it returns values like 2024, 2025, 2024, 2025,2024, 2025,2024, 2025,2024, 2025,2024, 2025,2024, 2025,2024, 2025,2024, 2025.

Basically for every row in dim_date it concatenates values. To avoide that we use VALUES function since it returns unqiue values.

No comments:

Post a Comment