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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SachinNamdeo-20
Helper II
Helper II

Calculate Effective Dealer

I want to calculate only   count of  Effective dealer,
Effective dealer condition is :- Which dealer has  previous 3 month avarage sales  is greater than 40 is satisfied the condition of effective dealer please help to provide dax query for this 
" 3 Month avarage sale measure is :- Table name- cube invoice

    3mth avarage sales = CALCULATE(SUM(CUBE_INVOICE[INVOICE QUANTITY]),DATESINPERIOD(CUBE_INVOICE[D         DATE.FULLDATE],LASTDATE(CUBE_INVOICE[D DATE.FULLDATE]),-3,MONTH))/3"
datesold to partner code invoice quantity 
1-11-22abc12320 
2-11-22abc45680 
''..........''"..........""........" 
Screenshot (29).png
1 ACCEPTED SOLUTION

So you need to count the effective Dealers for a given selection? 

Try something like

 

Effective Count = SUMX( VALUES( invoice[DEALER]), IF (  [3 MONTH AVERAGE] >= 40, 1))
 Where :
 [3 MONTH AVERAGE] = CALCULATE(SUM(invoice[INVOICE QUANTITY]),DATESINPERIOD(invoice[DATE],LASTDATE(invoice[DATE]),-3,MONTH))/3

 

This will aggregate up to the total effective dealers:

In a table with dealer:

pi_eye_0-1670448829984.png

 

In object on it's own:

pi_eye_1-1670448890602.png

 

 

If this is not what you need, can you illustrate maybe using excel just to show what the end result what look like?

 

Thank you

 

Pi

View solution in original post

5 REPLIES 5
pi_eye
Resolver IV
Resolver IV

Hi @SachinNamdeo-20 

 

where are you using this measure?

 

If you have the average over 3 months calculated, you can just apply an if statement:

 

 

 

 

3 MONTH AVERAGE = CALCULATE(SUM(invoice[INVOICE QUANTITY]),DATESINPERIOD(invoice[DATE],LASTDATE(invoice[DATE]),-3,MONTH))/3

 

Is Effective? = IF([3 MONTH AVERAGE]>=40,"Y","N")
 
Recreation of data:
pi_eye_0-1670335023682.png

 

HTH,

 

Pi

 

 

I just want to show the actual count of effective dealer in card so i want just one value that is actual count of total effective dealer so thank you for the suggestion but i cant show the value in form of table

 

So you need to count the effective Dealers for a given selection? 

Try something like

 

Effective Count = SUMX( VALUES( invoice[DEALER]), IF (  [3 MONTH AVERAGE] >= 40, 1))
 Where :
 [3 MONTH AVERAGE] = CALCULATE(SUM(invoice[INVOICE QUANTITY]),DATESINPERIOD(invoice[DATE],LASTDATE(invoice[DATE]),-3,MONTH))/3

 

This will aggregate up to the total effective dealers:

In a table with dealer:

pi_eye_0-1670448829984.png

 

In object on it's own:

pi_eye_1-1670448890602.png

 

 

If this is not what you need, can you illustrate maybe using excel just to show what the end result what look like?

 

Thank you

 

Pi

"HEY ! now i want to calculate effective dealer sales ,can you healp me data is same for this

dealer invoice quantityeffective dealer  
a10   
b202b  
c28c  
d30   

Effective dealer measure was previous one Now i want a  calculated measure which can calculate effective dealer total sales"

Hi @SachinNamdeo-20 

 

You can try replacing the count in the expression with the sum:

Effective Dealer Total = SUMX( VALUES( invoice[DEALER]), IF (  [3 MONTH AVERAGE] >= 40, sum(invoice[INVOICE QUANTITY])))
 
Pi

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors