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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Jeffreyjar
Helper II
Helper II

Calculate the total number of an agent code

hello everyone 

 

please i need help 

i want to have the total of sales of an agent

 

this is the sample data for example

A10101001   255867,
A10101001    52500
A10101001      3500
A10101001      3500
A10101001      7907
A10101001     52500
A10101001      9870
A10101001     29608
A10101001     20000

 

the expected data must resume the total of sales like this

A10101001            259 942
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Jeffreyjar ,

Different from your expected result, you can see if my measure is correct.

Sales is calculated based on agent grouping – the result is 435252.

Here are the steps you can follow:

1. Create measure.

Measure =
SUMX(FILTER(ALL('Table'),'Table'[agent]=MAX('Table'[agent])),[Sales])

2. Result:

vyangliumsft_0-1662343531606.png

If you need pbix, please click here.

Calculate the total number of an agent code.pbix

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi  @Jeffreyjar ,

Different from your expected result, you can see if my measure is correct.

Sales is calculated based on agent grouping – the result is 435252.

Here are the steps you can follow:

1. Create measure.

Measure =
SUMX(FILTER(ALL('Table'),'Table'[agent]=MAX('Table'[agent])),[Sales])

2. Result:

vyangliumsft_0-1662343531606.png

If you need pbix, please click here.

Calculate the total number of an agent code.pbix

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors