cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
CSpina
Helper III
Helper III

Howto count customers per salesperson based on customer log (date)

Hi there!

I need to create a visual (matrix) to show the number of customers has per salesman and month. I was able to count the amount in the month, but in subsequent months the value becomes null.

 

CSpina_0-1676029977153.png

I need the a measure to count like that (number is red):

CSpina_1-1676030265659.png

 

 

Loga data

1112021-01-01
2212021-01-01
3312021-01-01
4412021-01-01
5512021-01-01
6312021-01-01
714202-10-09
8232021-11-06
9522021-12-10

 

Any ideas? Thanks in advance.

1 ACCEPTED SOLUTION

Hi @CSpina ,

 

I suggest you to create a new measure based on [Measure2].

Measure 3 = SUMX(VALUES('Table'[ID]),[Measure 2])

Result is as below.

RicoZhou_0-1677059742022.png

 

Best Regards,
Rico Zhou

 

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

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @CSpina ,

 

Here I suggest you to create measures to achieve your goal.

Measure = 
CALCULATE(COUNT('Table'[Column2]),FILTER(ALL('Table'),'Table'[ID] = MAX('Table'[ID])&&'Table'[Date]<=MAX('Date'[Date])))
Measure 2 = 
VAR _A = AVERAGEX(FILTER(ALL('Table'),'Table'[ID] = 1),[Measure])
VAR _B = SUMX(FILTER(ALL('Table'),'Table'[ID] <> 1),[Measure])
RETURN
if(MAX('Table'[ID]) = 1, _A -_B,[Measure])

Result is as below.

RicoZhou_0-1676366863190.png

 

Best Regards,
Rico Zhou

 

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

 

Thank you very much! We are almost there, I need a rows total and could you please send thesample pbix?

Hi @CSpina ,

 

I suggest you to create a new measure based on [Measure2].

Measure 3 = SUMX(VALUES('Table'[ID]),[Measure 2])

Result is as below.

RicoZhou_0-1677059742022.png

 

Best Regards,
Rico Zhou

 

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

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors