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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Search for missing dates and values

Hello! 

 

 

For exampleFor exampleHow can I get the value from previous dates, if my column has more dates than other table?

1 ACCEPTED SOLUTION

Here it is,

I have named these 2 tables as A and B

 

First create a calculated column in the first Table shown in the Picture

DateKEY = A[Date]&A[KEY]

 

 

and then create another calculated column to get the revenue

Result=LOOKUPVALUE(A[Revenue],A[DateKEY],IF(ISBLANK(LOOKUPVALUE(A[Date],A[DateKEY],B[Date]&B[KEY])),CALCULATE(MAX(A[Date]),FILTER(A,A[Date]<EARLIER(B[Date]))),LOOKUPVALUE(A[Date],A[DateKEY],B[Date]&B[KEY]))&B[KEY])

View solution in original post

3 REPLIES 3
iamprajot
Responsive Resident
Responsive Resident

not sure what is it that you need from what is shown here.
Anonymous
Not applicable

Hello!Снимок.JPG

 

I need a column, where calculate 'revenue' by date, and key. If date is blank, I need previous value (revenue).

 

Thanx!

 

Here it is,

I have named these 2 tables as A and B

 

First create a calculated column in the first Table shown in the Picture

DateKEY = A[Date]&A[KEY]

 

 

and then create another calculated column to get the revenue

Result=LOOKUPVALUE(A[Revenue],A[DateKEY],IF(ISBLANK(LOOKUPVALUE(A[Date],A[DateKEY],B[Date]&B[KEY])),CALCULATE(MAX(A[Date]),FILTER(A,A[Date]<EARLIER(B[Date]))),LOOKUPVALUE(A[Date],A[DateKEY],B[Date]&B[KEY]))&B[KEY])

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.