Forum Discussion

gustavo_powerbi's avatar
gustavo_powerbi
New Member
4 years ago

Lost Costumers

Hi, I tried to realize a Dax measure about Lost Costumer, but I can't do this:

Running Total Sales =
VAR currentdate =
MAX ( Vtas_Zona_Atlantica[Date] )
RETURN
CALCULATE(
[AC],
FILTER (
ALLSELECTED( Vtas_Zona_Atlantica[Date] ),
ISONORAFTER( Vtas_Zona_Atlantica[Date], currentdate, DESC )
)
)

 

 

Lost Costumer =
VAR _currdate =
MAX ( Vtas_Zona_Atlantica[Date] )
VAR _Salesthisperiod = [Total Ventas]
VAR _Costumer =
ADDCOLUMNS (
Vtas_Zona_Atlantica,
"Sales Until Now",
CALCULATE(
[AC],
DATESINPERIOD( Vtas_Zona_Atlantica[Date], _currdate, -6, MONTH )
),
"Running Total Sales", [Running Total Sales]
)
VAR _LostCustomer =
FILTER (
_Costumer,
[Running Total Sales] > 0 && [Sales Until Now] = 0 )

RETURN
IF ( _Salesthisperiod > 0, COUNTROWS( _LostCustomer ) +0 )
 
When I put these values on the matrix table but, I don't have results. 

2 Replies