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).
Hi,
My solution:
Create a calculated column
DistinctRoute by customer =
VAR CurrencyCustomar = 'Table'[Customar]
RETURN
CALCULATE(DISTINCTCOUNT('Table'[Route]); FILTER(ALL('Table');'Table'[Customar] = CurrencyCustomar))
- misul8 years agoHelper I
shapkovromanBI My database is very big, and this formula takes a very very long time to run. This isn't ideal.. formula is still being calculated, it has been a few minutes now.
Update after 10 minutes .. still running. This formula can't be used ..as it takes more than 10 minutes time to run on my database.
Any further ideas?
- sscanlon4 years agoHelper II
Wanted to thank you, your method worked perfect and I was unpivoting columns previously and wanted an easier way. Thank you!