Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
126 | |
78 | |
78 | |
60 | |
51 |
User | Count |
---|---|
164 | |
84 | |
68 | |
68 | |
58 |