Forum Discussion

sunah132's avatar
sunah132
Helper I
2 years ago
Solved

count rows as subtotal

Hi, I'm building a report that would have count rows as subtotal, not the actual sum of the values during the date period. From current view to count distinct row view, how can I manipulate to have this view?

Thank you in advance!

Current View   
ID17-Jun18-Jun19-JunTotal order
1234565106
     
     
Count row view   
ID17-Jun18-Jun19-JunOrdered days
1234565102
  • sunah132 , You need to create a measure that calculates the number of days with orders for each id

     

    OrderedDays =
    CALCULATE(
    COUNTROWS(
    FILTER(
    SUMMARIZE(
    TableName,
    TableName[ID],
    TableName[DateColumn],
    "OrderCount", SUM(TableName[OrderCount])
    ),
    [OrderCount] > 0
    )
    )
    )

     

    I have attached PBIX with your sample data

2 Replies

  • sunah132 , You need to create a measure that calculates the number of days with orders for each id

     

    OrderedDays =
    CALCULATE(
    COUNTROWS(
    FILTER(
    SUMMARIZE(
    TableName,
    TableName[ID],
    TableName[DateColumn],
    "OrderCount", SUM(TableName[OrderCount])
    ),
    [OrderCount] > 0
    )
    )
    )

     

    I have attached PBIX with your sample data

    • sunah132's avatar
      sunah132
      Helper I

      Thank you! It helped exactly how I was tried to solve. 🙂