Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Sum by Group - output question

Hi 🙂

 

I have a fairly simple question - tried searching but my answer may be lost in the countless posts on this.

 

I have a table that contains purchase orders, and each row is one line of each purchase order. I want to calculate the total of each purchase order as a whole.

 

Is there a way to group by each PO, and then save the output either as adding a new column, table, or a measure that I can then use?

 

Data looks like this :

 

 

PO NumberPO Line NumberApproved PO AmountRequestor
12345110Smith, John
1234522Smith, John
1234611Kelly, Mary
1234712Doe, Jane
1234725Doe, Jane

 

Would like to see :

 

PO NumberPO LinesRequestorPO Total
123452Smith, John12
123461Kelly, Mary1
123472Doe, Jane7

 

Any help would be great, as I am new and keen to learn.

  • Hi,

     

    Please try to create a What If parameter such as below:

    It will automatically create a slicer.

    Then create a check measure:

    Check = IF([PO Total]<SELECTEDVALUE(Parameter[Parameter]),1,0)

    Apply this measure to the original table visual.

    For example, i define a policy that the result only shows the rows which [PO Total] is less than the specified value from slicer.

    The result shows:

    Here is my test pbix file:

    pbix 

    Hope this helps.

     

    Best Regards,

    Giotto Zhi

     

8 Replies

  • v-gizhi-msft's avatar
    v-gizhi-msft
    Icon for Community Support rankCommunity Support

    Hi,

     

    Please try these two measures:

     

    PO Total = SUM('Table'[Approved PO Amount])
    PO Lines = COUNTROWS('Table')

     

    The result shows:

    Hope this helps.

     

    Best Regards,

    Giotto Zhi

    • Anonymous's avatar
      Anonymous
      Not applicable

      edit / nvm - figured it out. I can use the measure and apply a filter to it....

  • Create measures

    PO Lines = count(table[PO Line Number])
    PO Total = sum(table[Approved PO Amount])

     

    Rest should automatically group in Table and matrix

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Guys,

       

      Thanks so much for the help, it works great.

       

      Before I mark this as solved, I have another question.

       

      What would be the best way to add a filter to the report so the end user can view only the POs up to or under a certain value?

       

      For example, they want to only see POs up to $5000?

       

      Thanks

      • v-gizhi-msft's avatar
        v-gizhi-msft
        Icon for Community Support rankCommunity Support

        Hi,

         

        In your original sample table i can not see any data up to $5000.

        But if you want to apply filter to this visual, you can choose the specified field as a slicer, or directly add a filter to Filter Pane.

         

        Best Regards,

        Giotto Zhi