Forum Discussion
count rows vs has one value
- 8 years ago
Hi Ffitzpatrick47,
In this scenario, there is no difference.
VALUES returns a one-column table that contains the distinct values from the specified table or column. HASONEVALUE returns TRUE when the context for columnName has been filtered down to one distinct value only. The usage of these two functions are different, but the returned result is the same. They can be used to check the numer of unique records of a column.
Regards,
Yuliana Gu
Hi Ffitzpatrick47,
Based on my test, nesting HASONEVALUE inside IF function also worked.
Measure = IF(HASONEVALUE(<Your Column Here>)=TRUE(),
IF(VALUES(<Your Column Here>)=<Test Value Here>,
<Result if True>,
<Result if False>),
<Result for subtotals and grandtoals>)
If I have something misunderstood, please provide more description about your question.
Regards,
Yuliana Gu
- Ffitzpatrick478 years agoHelper II
No, I just wanted to know if there was a difference between using the two.
- v-yulgu-msft8 years agoMicrosoft Employee
Hi Ffitzpatrick47,
In this scenario, there is no difference.
VALUES returns a one-column table that contains the distinct values from the specified table or column. HASONEVALUE returns TRUE when the context for columnName has been filtered down to one distinct value only. The usage of these two functions are different, but the returned result is the same. They can be used to check the numer of unique records of a column.
Regards,
Yuliana Gu