Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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.

1 ACCEPTED SOLUTION

Hi,

 

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

19.PNG

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:

21.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

 

View solution in original post

8 REPLIES 8
amitchandak
Super User
Super User

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
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

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

Anonymous
Not applicable

The table was an example only as the real dataset is huge and contains sensitive information.

 

The field I want to filter by is the PO Total measure, but it wont allow me to use it on a slicer...?

 

I cant use the filter pane, I would rather have the user interact with the dashboard directly.

 

Thanks.

Hi,

 

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

19.PNG

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:

21.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

 

Anonymous
Not applicable

Thanks so much.

 

I would not have thought about doing it this way.

v-gizhi-msft
Community Support
Community Support

Hi,

 

Please try these two measures:

 

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

 

The result shows:

60.PNG

Hope this helps.

 

Best Regards,

Giotto Zhi

Anonymous
Not applicable

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.