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
Jeremyh
Frequent Visitor

DAX: Help returning a Value in a table based on MAX Date and another Matching field value

I Have a two Tables, 'Table 1' contains 1 record per Consignment (order) and 'Table 2' which contains many Scan Transactions with fields [Count of Scans], [Scan Branch] (Location), and [Scan Date]. These two table have a 1:Many relationship on the [Consignment Number] field.

 

2023-06-30_14h44_34.png

 

 

I need help with a DAX Statement that That returns the Value of the [Count of Scans] for the record with the Latest [Scan Date] and matching [Scan Branch] and [Destination Branch], If no matches return BLANK

 

From the above example, I would expect to the result to be 5

Appreciate any help.

1 ACCEPTED SOLUTION

Hi,

Please find attached my PBI file.

Hope this helps.

Untitled.png


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

View solution in original post

5 REPLIES 5
Jeremyh
Frequent Visitor

Thanks @Ashish_Mathur  Really Appreciate your help

You are welcome.


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

Hi,

Share the download link of the PBI file.  Do you want a measure or a calculated column formula solution?


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

Hi @Ashish_Mathur I'm wanting a Measure. I have already added a couple of measure that work correclty, returning the First and Last Dates RELATED to the Destination Branch in Table 1. But I'm struggling to return the Value for Count of Scans. In the Attached Report, I want to reutn:

 

ConsignmentNumber | Last Scan Count

ABC0034274    |    5
ABC0034275    |    6

 

Link to Project File: BI Project 

Appreciate any help

Hi,

Please find attached my PBI file.

Hope this helps.

Untitled.png


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.