Forum Discussion
Shane12311
2 years agoRegular Visitor
How to count the value in VALUES()
I have a formula like this:
TEST1 =
VAR VAR1 =
CALCULATE(
VALUES('TABLE1'[V1]),
FILTER(
'TABLE1',
'TABLE1'[V2] = 'TABLE2'[V2]
)
)
And for VAR1, some rows it returns one value and some row return more than one value, how can I count the number of values in VAR1?
And for VAR1, some rows it returns one value and some row return more than one value, how can I count the number of values in VAR1?
Short answer: as VALUES(tablename[columnname]) gives you a single column table of distinct values, you can use either COUNTROWS(VALUES(tablename[columnname])) or DISTINCTCOUNT(tablename[columnname])
I wonder what the bigger picture is here, like I wonder if that filter will work.
1 Reply
- sjoerdvn
Solution Sage
Short answer: as VALUES(tablename[columnname]) gives you a single column table of distinct values, you can use either COUNTROWS(VALUES(tablename[columnname])) or DISTINCTCOUNT(tablename[columnname])
I wonder what the bigger picture is here, like I wonder if that filter will work.