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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How to get MAX DATE for each account in the table

Hello Team,

Im creating a measure "GET_LIEN_STR_SA" it needs max date and conditions on few types and status. when I use MAX its just giving maximum date in that particular column keeping all other blank. I want max date for each record of account id .


 

Thanks in advance.

2 ACCEPTED SOLUTIONS
PijushRoy
Super User
Super User

Hi @Anonymous 

Can you please try DAX like the below (example only), please update the filter condition as per the requirement

 

CALCULATE(
    MAX('Table'[DateColumn]), 
    FILTER(
        'Table',
        'Table'[AccountID] = EARLIER('YourTable'[AccountID]) && 
        'Table'[Type] IN {"Type1", "Type2"} &&                   
        'Table'[Status] = "YourStatus"                           
    )
)

 

 


Let me know if that works for you


If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.

Thanks
Pijush
Linkedin




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





View solution in original post

Anonymous
Not applicable

Hi @Anonymous 

 

I ran the testing as follows.

 

My sample:

vxuxinyimsft_0-1708327709417.png

 

Measure:

 

GET_LIEN_STR_SA = CALCULATE(MAX([Date]), ALLEXCEPT('Table', 'Table'[ID], 'Table'[status]))

 

 

vxuxinyimsft_2-1708327942834.png

Is this the result you expect?

 

If I've misunderstood you, please provide detailed sample data and the results you are hoping for: How to provide sample data in the Power BI Forum - Microsoft Fabric Community . Or show it as a screenshot or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

 

Best Regards,
Yulia Xu

 

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
Anonymous
Not applicable

Hi @Anonymous 

 

I ran the testing as follows.

 

My sample:

vxuxinyimsft_0-1708327709417.png

 

Measure:

 

GET_LIEN_STR_SA = CALCULATE(MAX([Date]), ALLEXCEPT('Table', 'Table'[ID], 'Table'[status]))

 

 

vxuxinyimsft_2-1708327942834.png

Is this the result you expect?

 

If I've misunderstood you, please provide detailed sample data and the results you are hoping for: How to provide sample data in the Power BI Forum - Microsoft Fabric Community . Or show it as a screenshot or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

 

Best Regards,
Yulia Xu

 

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

PijushRoy
Super User
Super User

Hi @Anonymous 

Can you please try DAX like the below (example only), please update the filter condition as per the requirement

 

CALCULATE(
    MAX('Table'[DateColumn]), 
    FILTER(
        'Table',
        'Table'[AccountID] = EARLIER('YourTable'[AccountID]) && 
        'Table'[Type] IN {"Type1", "Type2"} &&                   
        'Table'[Status] = "YourStatus"                           
    )
)

 

 


Let me know if that works for you


If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.

Thanks
Pijush
Linkedin




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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.

Top Solution Authors