Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi,
I need help with my model. I try to compare the leads we have won this month with the last month. I use the next formula:
Solved! Go to Solution.
PREVIOUSMONTH(dateadd(Opo[Fecha de cierre real],-1,month))
means "go back one month and then take ALL DATES from the month before"
use
PREVIOUSMONTH(Opo[Fecha de cierre real])
instead if you want ALL DATES from the previous month,
or
dateadd(Opo[Fecha de cierre real],-1,month)
if you want to shift all the dates by a month into the past.
https://docs.microsoft.com/en-us/dax/previousmonth-function-dax
https://docs.microsoft.com/en-us/dax/dateadd-function-dax
use either previousmonth or dateadd.
Proud to be a Super User!
what's the formula you are using now?
maybe you can try
PrevMonth WIN LEADS = CALCULATE(Opo[Leads ganados],dateadd(Calendario[Date],-1,month),
USERELATIONSHIP(Opo[Fecha de cierre real],Calendario[Date]))
Proud to be a Super User!
PREVIOUSMONTH(dateadd(Opo[Fecha de cierre real],-1,month))
means "go back one month and then take ALL DATES from the month before"
use
PREVIOUSMONTH(Opo[Fecha de cierre real])
instead if you want ALL DATES from the previous month,
or
dateadd(Opo[Fecha de cierre real],-1,month)
if you want to shift all the dates by a month into the past.
You are basically applying Previous month twice. What made you choose USERELATIONSHIP? It is not required here.
Hi @lbendlin,
I can't saw where I use two times "previousmonth".
I have 5 date columns in the principal table, so I made 5 relations between de column "date" of the calendar table with each column type date of the principal table. I use USERELATIONSHIP because I have to use the relation with the other date column. For example, if I want to use "fecha alta" I use USERELATIONSHIP to switch the relation. Because I don't know how to pick another column type date if I don't use USERELATIONSHIP...
**I have to say that I use PBI since may and I'm noobie with it and there are some things that I don't understand at all.
Thanks,
Maria.