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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ahmed-
New Member

how can i get the last invoices date for each custmer by reports or by Powe BI iam using BC?

how can i get the last invoices date for each custmer by reports or by Powe BI iam using BC?

3 REPLIES 3
v-hjannapu
Community Support
Community Support

Hi @ahmed-,

Thank you  for reaching out to the Microsoft fabric community forum.
Thank you @Ashish_Mathur@ray_aramburo for your response regarding issue.

By using this Dax you get the last invoices date for each customer.

Last_Invoice_Date = 
CALCULATE(
    MAX(InvoicesDataTable[InvoiceDate]),
    ALLEXCEPT(InvoicesDataTable, InvoicesDataTable[CustomerID])
)

 I tested it with my sample data, and it worked fine. Please find the attached Pbix for your reference.
If this solution worked for you, kindly mark it as Accept as Solution and feel free to give a Kudos, so others can benefit as well.

Best Regards,
Harshitha.

 

 

Ashish_Mathur
Super User
Super User

Hi,

What is BC?  Using measures, you will have to use the LASTNONBLANK() function.  To receive more help, share some data to work with and show the expected result.  Share data in a format that can be pasted in an MS Excel file.


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

Hi @ahmed-  you will need to create a measure with a similar structure like this (I don't knpw your data) : 

Last_Invoice_Date = CALCULATE(MAX(InvoicesDataTable[InvoiceDate]), ALLSELECTED(CustomersDataTable[Customer]))

If this is helpful mark it as solved so it can help for future references, otherwise, kindly provide more details of your data. 





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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