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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Sarakoth
Frequent Visitor

Count distinct at daily level and then aggregate (sum) this figure to monthly and year level.

Hi Everyone,

 

I have tried finding an answer to this and many things come close but I can't quite nail it.

 

Essentially I have some salesmen, that accept orders at a location. I am trying to determine the number of distinct times a order has been made by a salesmen at each location on a daily level. I then want to aggregate this figure up to a monthly or yearly level.

 

So if a salesmen makes multiple orders at a location, it is only counted as 1. 

 

My chart displays my distinctcount measure correctly at the daily level, but when I try to display at monhtly or yearly level is applies the distinctcount at that level and is therefore wrong.

 

Some sample raw data is:

 

DateSalesmen IDLocation IDOrder ID
4/08/20231551001
4/08/20231551002
4/08/20232551003
4/08/20233771004
4/08/20233771005
10/08/20231551006
12/08/20232771007
12/08/20232771008
12/08/20233771009
12/08/20231551010

 

So the daily values I am expecting would be:

 

DailyLocationDistinct Count Salesmen
4/08/2023552
4/08/2023771
10/08/2023551
12/08/2023551
12/08/2023772

 

So noticing that on the 4th Aug, 5 orders are reduced to a distinct count of salesmen by location for a result of 3.

 

Then I wish to simply show these on a chart effectivly like this:

 

MonthlyLocationCount
Aug-23554
Aug-23773

 

So August would totals 7, not the underlying 10 orders.

 

Any suggestions would be much appreciated.

 

 

2 REPLIES 2
JoeBarry
Solution Sage
Solution Sage

Hi @Sarakoth 

 

As the Sales Man ID should be visible with each sale, we will use this to count

 

Unique Sales per Visit = DISTINCTCOUNT(Sales[SalesManID])

 

In a Table you can add  the Date then the location and then the new Measure. 

Similar if you want to see how many total sales there are 

 

Total Sales = DISTINCOUNT(Sales[OrderID])

 

Thanks

Joe

 

If this post helps, then please Accept it as the solution

Hi Joe,

 

Thanks for your suggestion. 

 

However I don't believe that works as I need as I roll up from daily to monthly.

 

Here is an example (not the exact same data as I gave above but hopefully still makes sense). 

 

Here are the orders at a daily level. 

 

Sarakoth_0-1693377598735.png

 

 

You can see a total of 7 in August.

 

However on the 4th of August, the same salesmen had 2 orders in the same location.

 

So when I look for distinct on a daily level (using the measure definition you gave), the following chart is CORRECT.

 

Sarakoth_1-1693377713783.png

 

So on the 4th, there were 3 different salesmen with orders in Fremantle. You can see this adds up to 6, and not 7.

 

Yet if drill up to monthly level (which is what I want to display), my chart now looks like this:

 

Sarakoth_2-1693377832994.png

 

Which is WRONG.. it has now selected distinct combinations of locations and salesmen for the whole month, so is showing 4, not 6.  (2 salesmen have orders at the same location during the month so these are being dropped). The same problem would occur if I drill up to yearly level.

 

I am not sure if I can change or add items to the chart to make this work or I feel the measure needs to changed.

 

 

 

 

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors