Forum Discussion
How to create a calculated distinct count if column (referencing another table)
- 8 years ago
Thanks, i removed the MAX from the function and worked accordingly as what i expected.
(Ignore the total count, i have a space in one of the data, this function worked even better detecting that as same)
I'm not totally sure I get what your problem is, but these may help you.
http://www.daxpatterns.com/distinct-count/
https://powerpivotpro.com/2017/02/uses-for-new-table-feature-power-bi/
Maybe you can create a summary table and join this to the Wave 1 timelines and add a Measure to count disctict products.
Manufacturer Products =
ADDCOLUMNS (
SUMMARIZE (
'Report 1',
'Report 1'[Manufacturer (Import ID)],
'Report 1'[Product (Import ID)]
),
"ReportLines", CALCULATE ( COUNTROWS ( 'Report 1' ) )
)
Or you can do it in one pass with something like this.
DistinctCount =
CALCULATE (
DISTINCTCOUNT ( 'Report 1'[Product (Import ID)] ),
FILTER (
SUMMARIZE (
'Report 1',
'Report 1'[Manufacturer (Import ID)],
'Report 1'[Product (Import ID)]
),
'Report 1'[Manufacturer (Import ID)] = MAX ( 'Wave1 timelines'[Vendor] )
)
)
Thanks, i removed the MAX from the function and worked accordingly as what i expected.
(Ignore the total count, i have a space in one of the data, this function worked even better detecting that as same)
- stretcharm8 years ago
Memorable Member
great stuff