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
Diego_Vialle
Helper II
Helper II

DAX - time graph for a measure

Hello, I have a measure that adds up the billing value of customers who NEVER bought BUT BUY in the last two months.

 

When including the measure of the sum of these values, I cannot use the Calendar table. How do I show these measurement values of the last two months?

 

Diego_Vialle_0-1651672596480.png

 

Diego_Vialle_2-1651673212310.png

 

Below is the formula I use to show customers who NEVER bought BUT BUY in the last two months:

 

Qtd. Faturamento Bimestral =
VAR AllOldCustomers =
CALCULATETABLE (
VALUES ( SBOPRODMS[Nome do PN] ),
SBOPRODMS[Data NF]
< TODAY () - 60,
SBOPRODMS[Documento] = "Nota fiscal de saída"
)
VAR AllNewCustomers =
CALCULATETABLE (
VALUES ( SBOPRODMS[Nome do PN] ),
AND (
SBOPRODMS[Data NF]
< TODAY (),
SBOPRODMS[Documento] = "Nota fiscal de saída"
)
)
VAR NewCustomers =
EXCEPT ( AllNewCustomers, AllOldCustomers )
RETURN
CALCULATE (
DISTINCTCOUNT ( SBOPRODMS[Nº Documento] ),
FILTER (
SBOPRODMS,
SBOPRODMS[Nome do PN]
IN NewCustomers
&& SBOPRODMS[Documento] = "Nota fiscal de saída"
)
)
 
Below is the formula I use to add the value of the invoices of these customers in the table:
 
Soma Novos Clientes Bimestrais =
SUMX (
VALUES ( SBOPRODMS[Nome do PN] ),
IF ( [Novos Clientes Bimestrais] = 1, [Valor NET | NF] )
)
 
Diego_Vialle_3-1651673798000.png

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Diego_Vialle , Consider this

Customer has transaction in last 60 days

Rolling 60 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-60,Day))

 

 

Customer do have in last 60 days

countx(values(Customer[Customer]) , if(isblank([Rolling 60]), [Customer], Blank())

 

refer

Customer Retention Part 5: LTD Vs Period Retention
https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-5-LTD-and-PeriodYoY-Retentio...

 

Customer Retention Part 2: Period over Period Retention :https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retenti...

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Diego_Vialle , Consider this

Customer has transaction in last 60 days

Rolling 60 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-60,Day))

 

 

Customer do have in last 60 days

countx(values(Customer[Customer]) , if(isblank([Rolling 60]), [Customer], Blank())

 

refer

Customer Retention Part 5: LTD Vs Period Retention
https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-5-LTD-and-PeriodYoY-Retentio...

 

Customer Retention Part 2: Period over Period Retention :https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retenti...

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.