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

I hope I understood your request. And hope this answers your question.

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

Thank you so much for the answers they worked perfect, I have 1 more question:
I have internal sales people that will get the following commission:
1st year 12%
2nd year 6%
In my data model I have Date, Company Name, monthly payment, if the company started day is April 1,2021, then my sales person will get 12% until March 31,2022, after that day on April 1, 2022 the % will change to 6%
Thank you so much in advance

Keith,
I do not know how to deleted!!

Done thank you!!!

looks like you figured it out…don’t forget your first message :slight_smile:

Keith, please tell me where I can initiate my new question??

move your mouse over the blue circle bottom right hand corner on the main screen it will change to add new topic and click on it
screen print below.

you should be fine from there
thanks
keith