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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
AwaisAnwar
Frequent Visitor

Getting last record of table for each customer Power bi

I have a transections table for sales record, i want to get customer wise last row record. How can i do in dax? P.S it is not intended to get latest purchase date of customer. I need full row of table
1 ACCEPTED SOLUTION
v-jiewu-msft
Community Support
Community Support

Hi @AwaisAnwar ,

Please try the following methods and check if they can solve your problem:

1.Create the simple table.

vjiewumsft_0-1710841195732.png

2.Create the new measure to filter.

 

 

Last Record = 
VAR Record_Customer = CALCULATE(
    MAX('Table'[Date]),
    ALLEXCEPT('Table', 'Table'[customer])
)
RETURN
IF(MAX('Table'[Date]) = Record_Customer, 1, 0)

 

 

3.Drag the measure into the Filters pane and set the show items is 1.

vjiewumsft_1-1710841232980.png

4.The result is shown below.

vjiewumsft_2-1710841239798.png

 

Best Regards,

Wisdom Wu

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

2 REPLIES 2
v-jiewu-msft
Community Support
Community Support

Hi @AwaisAnwar ,

Please try the following methods and check if they can solve your problem:

1.Create the simple table.

vjiewumsft_0-1710841195732.png

2.Create the new measure to filter.

 

 

Last Record = 
VAR Record_Customer = CALCULATE(
    MAX('Table'[Date]),
    ALLEXCEPT('Table', 'Table'[customer])
)
RETURN
IF(MAX('Table'[Date]) = Record_Customer, 1, 0)

 

 

3.Drag the measure into the Filters pane and set the show items is 1.

vjiewumsft_1-1710841232980.png

4.The result is shown below.

vjiewumsft_2-1710841239798.png

 

Best Regards,

Wisdom Wu

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

 

audreygerred
Super User
Super User

You can create a DAX table to achieve what you are looking for. Here is a link to SUMMARIZE DAX function: SUMMARIZE function (DAX) - DAX | Microsoft Learn




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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