Forum Discussion
Count based on another column
- 8 years ago
hello misul,
You could try:
Column = CALCULATE( DISTINCTCOUNT(Table1[Route]), ALLEXCEPT(Table1,Table1[Customer]) )
- 8 years ago
ChrisMendoza Correct, the intention is to use DistinctCountofRoutes as a slicer.
When I use the calculated column, the values are summed. So I put the column to "Don't Summarize" and it seems to work now. Thanks!Calculated Column:
Column = CALCULATE( DISTINCTCOUNT(Table1[Route]), ALLEXCEPT(Table1,Table1[Customer]) )
Measure:
Measure= CALCULATE( DISTINCTCOUNT(Table1[Route]), ALLEXCEPT(Table1,Table1[Customer]) )
I realised that the same formula can be used as a measure too. But as measures cannot be used in Slicers. I will stick with Calculated Column (without summarizing it).
hello misul,
You could try:
Column = CALCULATE( DISTINCTCOUNT(Table1[Route]), ALLEXCEPT(Table1,Table1[Customer]) )
ChrisMendoza , In this example, if I need to filter the Table1[Route] <> 4, for example, How I can change the formula to Calculate DistinctCount Table1[Route] by Table1[Customer]) but not considering the records with Table1[Route] = 4.
I tried to include the filter in the table but I got the message "Parameter is not the correct type"
In my case mey formula is:
CALCULATE(DISTINCTCOUNT(Suppliers[PART_STATUS]),
ALLEXCEPT( FILTER(Suppliers, RELATED(Suppliers[PART_STATUS])<> "U") ,
Suppliers[KEY]) ).
thank you!