Forum Discussion
How to dynamically count unique values in a table visual
- 5 years ago
Hey ssingh33 ,
I think that description helped me to understand your result better 😊
Try that version:
Unique Products = CALCULATE( DISTINCTCOUNT( mytable[product] ), ALLEXCEPT( myTable, myTable[Account], myTable[Date] ), ALLSELECTED( myTable[Date] ) )If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic
Hey ssingh33 ,
I think that description helped me to understand your result better 😊
Try that version:
Unique Products =
CALCULATE(
DISTINCTCOUNT( mytable[product] ),
ALLEXCEPT(
myTable,
myTable[Account],
myTable[Date]
),
ALLSELECTED( myTable[Date] )
)
Hi selimovd
This works for me, except that distinctcount does not count the 'object' with an empty value.
In other words: A location has 100 objects and every object has a value column. I want to know how many objects I have, even when this value column is empty. But I want to have it dynamic, because some objects are irrelevant based on a filter (like when an object only shows midnight values, it does not belong in the midday objects).
The concrete issue is that I wanted to compare corresponding objects from different locations, but 1 small location did not show that object (the values show how many issues that object had in the past year).
I might decide to use the non dynamic count if this does not work.
Here is my Measure (TagCode being all the unique objects from all locations):