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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
kdixon5490
Helper III
Helper III

Create a measure that looks at the first column and if blank takes to 2nd column from another table

Current I have 2 tables in my POWERBI desktop report.

Table 1 with 1 record per Day

Table 2 has multiple records for 1 day

They are related with a One to Many relationship.

 

I need to create a measure in Table 2 that looks at a field. 'Table2(Max Tempature) and if that is Null then replace it with the 'Table1'(Max Tempature).

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You need to create calculated column ( Not calculated Measure ). 

 

Thanks
Raj

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @kdixon5490 

  You need to use RELATED function for this use case, which needs row context. So, you need to create a calculated column. Pls make sure to have a relationship between both columns.

 

Create the  calculated column using the below formula. Example is given below.

Grouping.PNG

 

 

Thanks

Raj 

I typed in the information given and I'm getting the following error...

EARLIER/EARLIEST refers to an earlier row context which doesn't exist.

Anonymous
Not applicable

You need to create calculated column ( Not calculated Measure ). 

 

Thanks
Raj

Ashish_Mathur
Super User
Super User

Hi,

Create a relationship from the Date column of Table2 to the Date column of Table1.  In Table2, write this calculated column formula

=if(isblank('Table2'[Max empature]),related('table1[Max tempature]),'Table2'[Max empature]))

or

=coalesce('Table2'[Max empature],related('table1[Max tempature]))

The second one is better.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors