Forum Discussion
Sum/Count of distinct column values based on another column
- 8 years ago
I would use the Query Editor to get your data into the following format:
Order Number, Month, Type, Date
2000, Jun, Order Received, 01/06/2017
2000, Jun, Order Delivered, 26/06/2017
2000, Jun, Payment Received, 30/06/2017
...
You should be able to do this by either breaking this into multiple queries and appending or potentially unpivoting columns but for data in that format, I'm thinking multiple queries and appending together.
At that point, your issue becomes fairly simple, you simply need a COUNT of each Type and a visual that includes Month and the measures you create for these, which would look something like:
Orders Delivered = COUNT(Table[Order Number],FILTER(Table,[Type]="Order Delivered"))
I would use the Query Editor to get your data into the following format:
Order Number, Month, Type, Date
2000, Jun, Order Received, 01/06/2017
2000, Jun, Order Delivered, 26/06/2017
2000, Jun, Payment Received, 30/06/2017
...
You should be able to do this by either breaking this into multiple queries and appending or potentially unpivoting columns but for data in that format, I'm thinking multiple queries and appending together.
At that point, your issue becomes fairly simple, you simply need a COUNT of each Type and a visual that includes Month and the measures you create for these, which would look something like:
Orders Delivered = COUNT(Table[Order Number],FILTER(Table,[Type]="Order Delivered"))