 # Calculating amounts

Hi guys,
I have the following question:
I have a column A( Income ), example 100, then I have to pay 3 sales persons, 20 each, when the payment is done there is a specific column with P, what will be the dax formula to calculate all P and all without P
20 P. Peter 20
30 Juan 50 P. Sam \$ 50. the result add all P =\$70
No “P”. add all. = \$30
Thanks

Hi! @Octavio,
I didn’t understand very well your question. Can you add more details, like how do you calculate the payment everyone gets, and is the payment fixed or it’s changing. If you can upload a picture or a PBIX sample that would be great.

What I want to do is add all with a P, and then add all without P

If I understood well, you want to sum the columns that contain the mention P and sum all the others that does not contain P. If that’s the case you just need to create simple measures.
1st measure :
`Total Amounts : Sum (Table [column of amounts ] )`

2nd Measure : amounts with P
`Amounts with P = Calculate ( [Total Amounts]`,
Filter( Table, (column where there’s P) =“P”) )

3rd Measure : amounts without P
`Amounts without P = Calculate ( [Total Amounts]`,
Filter( Table, (column where there’s P) <>“P” ) )

Thanks for posting your question @Octavio. To receive a resolution in a timely manner please make sure that you provide all the necessary details on this thread.

Here is a potential list of additional information to include in this thread; demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.

Including all of the above will likely enable a quick solution to your question.

1 Like

Thank you for the answer, great help
OR

Other way you can do is

Total Sales with P =
SumX
(Filter (Table, Table[Value] = "P’), [Total Amount])

Total Sales with NO P =
SumX(Filter( Table, Table[Value] <> "P’), [Total Amount])