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

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.

Reply
tchalkias
Regular Visitor

get data from another date column

hi everyone, 

i need your help...

 

i need to receive data from another column in my date table.

i have for example my current date 24-10-2022 in my calendar and i need to show data from friday 21-10-2022.

 

to do that i have managed to enter a new column to my calendar which is prevworkingday and now my only problem is how to get data from this date and not from my current date 24-10-2022.

tchalkias_0-1666610924115.png

 

4 REPLIES 4
Anonymous
Not applicable

Hi @tchalkias ,

 

I suggest you to try this code to get data from other column by [PrevWorkingDay] column.

Data =
CALCULATE (
    SUM ( 'TableName'[Data] ),
    FILTER (
        'TableName',
        'TableName'[Date] = EARLIER ( 'Calendar'[PrevWorkingDay] )
    )
)

Here we use SUM() to get data in number type. If you want to get text type data, try Max().

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi @Anonymous i get this message 

i wrote the following
PrevWorkDayData =
CALCULATE (
    SUM ('PBI_Sales_Orders'[Amount]),
    FILTER (
        'PBI_Sales_Orders',
        'PBI_Sales_Orders'[Order Date] = EARLIER ( 'Calendar'[PrevWorkingDay] )
    )
)
and get this message in return
"EARLIER/EARLIEST refers to an earlier row context which doesn't exist."
i tried this today ,what do you think..
 
PrevWorkDayAmnt = CALCULATE('PBI_Sales_Orders'[TotalOrderAmount],USERELATIONSHIP(PBI_Sales_Orders[Order Date],'Calendar'[PrevWorkingDay]))
Anonymous
Not applicable

Hi @tchalkias ,

 

Please make sure which table did you add this calculated table. Here you use EARLIER('Calendar'[PrevWorkingDay] ), so this calculated column should be added in 'Calendar' table. Or you will get this error message "EARLIER/EARLIEST refers to an earlier row context which doesn't exist."

If this reply still couldn't help you solve your issue, please share a easy sample with me and show me a screenshot with the result you want.
 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous ,thanks for your replies!

 

My calendar has the column PrevWorkingDay like this...

tchalkias_0-1666694393925.png

isn't it correct?

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors