Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 MauriceLudo
		
			MauriceLudo
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
Please I would like to calculate the sum of sales before and after March 2018:
- if date > March 2018 : sum({<[Produits/Services]={'NSS & CCD '}>}[VENTE PRIS])
- if Date < March 2018 : sum({<[Produits/Services]={'NSS'}>}[VENTE PRIS])
please what is the best solution
Thank you
Best regards
Maurice
 YoussefBelloum
		
			YoussefBelloum
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
you can try this:
sum({<[Produits/Services]={'NSS & CCD '},DATE_FIELD={"<032018"}>}[VENTE PRIS])
but before doing this, you should know the format of your date field, example
1. if your date field format is: DD/MM/YYYY:
sum({<[Produits/Services]={'NSS & CCD '},DATE_FIELD={"<01/03/2018"}>}[VENTE PRIS])
2. if your date field format is: MMYYYY
sum({<[Produits/Services]={'NSS & CCD '},DATE_FIELD={"<032018"}>}[VENTE PRIS])
Also, your date field must be evaluated as a date
 MauriceLudo
		
			MauriceLudo
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thank you,
but for the seconde condition
if Date > March 2018 : sum({<[Produits/Services]={'NSS'}>}[VENTE PRIS])
how to do?
 YoussefBelloum
		
			YoussefBelloum
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Same as above, just replace < by >
example:
sum({<[Produits/Services]={'NSS & CCD '},DATE_FIELD={">032018"}>}[VENTE PRIS])
 MauriceLudo
		
			MauriceLudo
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		if date > March 2018 : sum({<[Produits/Services]={'NSS & CCD '}>}[VENTE PRIS])
- if Date < March 2018 : sum({<[Produits/Services]={'NSS'}>}[VENTE PRIS])
 YoussefBelloum
		
			YoussefBelloum
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		ah sorry, I didn't pay enough attention on this one, so try this:
sum({<[Produits/Services]={'NSS'},DATE_FIELD={">032018"}>}[VENTE PRIS])
