March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have a measure that calculates the last date in a table:
Last Date in Receipts CY =
MAX(Receipts[BI Date])
I have a second measure that takes that same date and subtracts a year:
Last Date in Receipts PY =
EDATE(MAX(Receipts[BI Date]),-12)
When I drop them onto a card, they both show the date I expect.
I have a table that is created using the first measure that works perfect:
CY =
FILTER (
Receipts,
AND (
Receipts[BI Date] >= DATE ( 2023, 7, 1 ),
Receipts[BI Date] <= [Last Date in Receipts CY]
)
)
Here is where the problem is. When I try to create a second table with everything the same as the CY table, except for that last date is the using the Last Date in Receipts PY Measure, the table does not show any data:
PY =
FILTER (
Receipts,
AND (
Receipts[BI Date] >= DATE ( 2022, 7, 1 ),
Receipts[BI Date] <= [Last Date in Receipts PY]
)
)
If I change my above measure to type in the date manually, it does populate correctly:
PY =
FILTER (
Receipts,
AND (
Receipts[BI Date] >= DATE ( 2022, 7, 1 ),
Receipts[BI Date] <= DATE(2023,03,01)
)
)
What am I doing to that [Last Date in Receipts PY] measure where it is not working to populate the table?
Edited to add: No errors pop up. The column headings do populate but no data populates.
Solved! Go to Solution.
I tried this as well hoping that it would work but not luck so I think it's that I am using edate but I don't know what to use instead:
PY =
FILTER (
Receipts,
AND (
Receipts[BI Date] >= DATE ( 2022, 7, 1 ),
Receipts[BI Date] <= edate([Last Date in Receipts CY],-12)
)
)
Whoever comes to see this in the future, here is what I did that worked:
PY =
VAR PYDateEnd =
EDATE(MAX(Receipts[BI Date]),-12)
VAR PYStartDate =
EDATE(min(CY[BI Date]),-12)
RETURN
FILTER (
Receipts,
AND (
Receipts[BI Date] >= PYStartDate,
Receipts[BI Date] <= PYDateEnd
)
)
The PYStartDate is referencing to take the minimum date in my CY table and subtract out 12. The table wouldn't work when I referenced a measure with EDATE but it worked when I used it as VAR.
Glad to hear you solved the problem! Could you please mark your solution as an ANSWER? This will help more users who are facing the same or similar difficulties. Thank you!
Best Regards,
Yulia Xu
Thanks for letting me know! I'm still very new to PowerBI and the Community.
I tried this as well hoping that it would work but not luck so I think it's that I am using edate but I don't know what to use instead:
PY =
FILTER (
Receipts,
AND (
Receipts[BI Date] >= DATE ( 2022, 7, 1 ),
Receipts[BI Date] <= edate([Last Date in Receipts CY],-12)
)
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
146 | |
97 | |
79 | |
69 |