Forum Discussion
StevenUser123
3 years agoFrequent Visitor
Using DISTINCT COUNT on a Measure
Hello, I have a measure that calculates quantity based on a calculation of attribute and value (As in, Attribute = QTY and Value = 1), summed as Current Quantity per line item. I am trying to figure...
- 3 years ago
Hi StevenUser123
Assuming all columns are coming from one table then you can useDistinct Count = COUNTROWS ( FILTER ( SUMMARIZE ( 'Table', 'Table'['Table'], 'Table'[Account Name], "@QTY", [Current Quantity] ), [@QTY] = 0 ) )In case Product Name and Account ID columns are coming from two different dimension tables then you may use
Distinct Count = COUNTROWS ( FILTER ( SUMMARIZE ( 'Sales', 'Product'['Table'], 'Customer'[Account Name], "@QTY", [Current Quantity] ), [@QTY] = 0 ) )
tamerj1
3 years agoCommunity Champion
Hi StevenUser123
Assuming all columns are coming from one table then you can use
Distinct Count =
COUNTROWS (
FILTER (
SUMMARIZE (
'Table',
'Table'['Table'],
'Table'[Account Name],
"@QTY", [Current Quantity]
),
[@QTY] = 0
)
)
In case Product Name and Account ID columns are coming from two different dimension tables then you may use
Distinct Count =
COUNTROWS (
FILTER (
SUMMARIZE (
'Sales',
'Product'['Table'],
'Customer'[Account Name],
"@QTY", [Current Quantity]
),
[@QTY] = 0
)
)
StevenUser123
3 years agoFrequent Visitor
Thank you so much!