Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply

Table Based Off Date Measure Not Populating

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. 

1 ACCEPTED 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)
    )
)

 

View solution in original post

4 REPLIES 4

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. 

Hi @ThisIsHalloween 

 

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)
    )
)

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.