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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Power_Bi_User12
New Member

Power BI Dax to get Most recent value from child table

Hi ,

 

I am new to Power BI and need help in developing a DAX formula to generate a report. 

 

I have 2 tables.

 

Table 1 :  

Req Details.PNG

 

Table 2 :

Com Table.PNG

 

Req ID is a foreign key from Table 1 to Table 2, I need to get the most recent comment from table 2 based on table 1 req ID and show as a table format.

 

Report.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Power_Bi_User12 ,

 

Based on your description, I create a simple sample(To avoid numerical effects, I've modified some of the data):

vtianyichmsft_0-1696987257445.png

 

Date Time =
CALCULATE ( MAX ( 'Comments Table'[Date Time] ) )

Comments =
CALCULATE (
    MAXX ( 'Comments Table', 'Comments Table'[Comments] ),
    FILTER ( 'Comments Table', MAX ( 'Comments Table'[Date Time] ) = [Date Time] )
)

Put these two measures in the Request Details table, if you don't want the data to be automatically aggregated, you can do so by selecting "show items with no data" for the Req ID.

 

The results are as follows:

vtianyichmsft_1-1696987257447.png

 

Perhaps this will work, and if you have any questions, please provide me with more information to make sure we can better solve the problem for you!

 

An attachment for your reference. Hope it helps.

 

Best regards,


Community Support Team_ Scott Chang

 

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

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Power_Bi_User12 ,

 

Based on your description, I create a simple sample(To avoid numerical effects, I've modified some of the data):

vtianyichmsft_0-1696987257445.png

 

Date Time =
CALCULATE ( MAX ( 'Comments Table'[Date Time] ) )

Comments =
CALCULATE (
    MAXX ( 'Comments Table', 'Comments Table'[Comments] ),
    FILTER ( 'Comments Table', MAX ( 'Comments Table'[Date Time] ) = [Date Time] )
)

Put these two measures in the Request Details table, if you don't want the data to be automatically aggregated, you can do so by selecting "show items with no data" for the Req ID.

 

The results are as follows:

vtianyichmsft_1-1696987257447.png

 

Perhaps this will work, and if you have any questions, please provide me with more information to make sure we can better solve the problem for you!

 

An attachment for your reference. Hope it helps.

 

Best regards,


Community Support Team_ Scott Chang

 

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

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.