Forum Discussion
Hopefully a simple Pivot Question on counting values
- Anonymous1 year ago
Hi MyWeeLola
Could you tell me how you would like it sorted by date?
I have some assumptions. If you want to sort attributes based on the earliest date they appear, you can create a new calculate column to query the minimum date for each Attribute:
Start DATE = CALCULATE( MIN('Table'[Date]), FILTER( ALL('Table'), 'Table'[Attribute] = EARLIER('Table'[Attribute]) ) )Then create the new calculate column:
MyScoreColumn = CALCULATE( DISTINCTCOUNT('Table'[Date]), 'Table'[Value] = 1, ALLEXCEPT('Table', 'Table'[Attribute]) )You can get:
If you're still having problems, provide some dummy data and the desired outcome. It is best presented in the form of a table.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Angith_Nair Thank you for the response. The code is struggling with the final distinctcount(daterange) as it is looking for a column reference as the value. Any thoughts?
Use COUNTROWS instead of DISTINCTCOUNT.
- MyWeeLola1 year ago
Helper II
Thank you for the response. The returned values are significantly higher than what is in the table. I notice that you have set a VAR for attributeValue, yet i do not see where it is used. Could this be the reason?
Lola