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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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