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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
khizerdaar
Frequent Visitor

Latest Available Month By Customer

I have a table named All Customer Files which contains the sales value column, [Value] and the date column, [End Date]. There is also a column that includes the names of various customers named [Customer]. 
 
I want to create a measure that shows the latest available month of sales data by customer. For example if Customer A, B and C's last month is Dec and Customer D's is Oct, then I want those months to display for each customer.
 
The best, I could come up with is the below measure, which identifies the last available month as December and shows only Customer A, B and C. How do I get the measure to filter for the last available month by customer?
 
Current Month = CALCULATE(SUM('All Customer Files'[Value]),FILTER('All Customer Files',MONTH('All Customer Files'[End Date].[Date])=MONTH(MAX('All Customer Files'[End Date]))))
3 REPLIES 3
Tahreem24
Super User
Super User

@khizerdaar ,

 

Create a measure like below:

Max_Date = MAX('Table'[DateColumn])
 
Then Take one table and put this measure and name of custome so you'll get the latest dates against each customer. (refer below screen shot)
Capture.JPG
 
Don't forget to give thumbs up 👍 and accept this as a solution if it helped you.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
danextian
Super User
Super User

Try something like:
Format(Calculate(max(table[date]),allexcept(table[customer])), "mmm yyyy")
This can be either as a measure or a calculated column.









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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Sorry. Should have been allexcept(table, table[customer]).









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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.