Forum Discussion

amitjangle's avatar
amitjangle
Regular Visitor
8 years ago
Solved

Sum/Count of distinct column values based on another column

Hello experts,   I am new in powerbi. Need help in below case.   I have order table like below. Order Received Date Order Received Month Order Number Order Delivered On Order Delivered Mo...
  • Greg_Deckler's avatar
    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"))