Forum Discussion
Distinctcount based on unique key
- 6 years ago
Hi, Anonymous
Based on your description, I created data to reproduce your scenario.
Table:
Then you may create a column or a measure as follows. I hope it may help you.
calculated column: Two>fueltype column = IF( COUNTROWS( FILTER( ALLSELECTED('Table'), 'Table'[Unique Number] = EARLIER('Table'[Unique Number]) ) )>=2, "equal or more than two", "only one" ) measure: Two>fueltype measure = IF( COUNTROWS( FILTER( ALLSELECTED('Table'), 'Table'[Unique Number] = MAX('Table'[Unique Number]) ) )>=2, "equal or more than two", "only one" )You may display the result with a table visual.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Anonymous
Based on your description, I created data to reproduce your scenario.
Table:
Then you may create a column or a measure as follows. I hope it may help you.
calculated column:
Two>fueltype column =
IF(
COUNTROWS(
FILTER(
ALLSELECTED('Table'),
'Table'[Unique Number] = EARLIER('Table'[Unique Number])
)
)>=2,
"equal or more than two",
"only one"
)
measure:
Two>fueltype measure =
IF(
COUNTROWS(
FILTER(
ALLSELECTED('Table'),
'Table'[Unique Number] = MAX('Table'[Unique Number])
)
)>=2,
"equal or more than two",
"only one"
)
You may display the result with a table visual.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Allen,
Thank you so much. This had been bothering me for days. Kudos to you!
Regards,
Jur