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

summing the latest entry by date

Hi, 

 

I have store sales data by reporting week, but not each reporting week has data for each store. What I want to do is create a new table by reporting week that sums the sales data of the latest entry of each store in order to create a line graph by reporting week.

ROWSTORE_KEYReporting Week (a)ValueThis entry rank by store
1A201801342.991
2A2018022,608.262
3B2018022,771.601
4B20180410,613.882
5A201805852.88

3

 

 

 

Reporting Week (b)ValueCalculation explantion 1Calculation explantion 2Calculation explantion 3
201801342.99Row 1342.99 + nullonly store 2497 has entry before or equal to week 201801
2018025,379.86Row 2 + Row 32,608.26 + 2,771.60Row 1 data from 201801 is replaced by Row 2 data from 201802
2018035379.86Row 2 + Row 32,608.26 + 2,771.60No new data from 201803 so latest data from 201802 is used
20180413,222.14Row 2 + row 42,608.26 + 10,613.88, Store A's latest data is from 201802 so this is used, Store B has data from 201804 which is used
20180511,466.76Row 4 + Row 510,613.88 + 852.88Store A has data from 201805 so this is used, Store B's latest data is still from 201804

 

 

I've been succesfull in summing the sales value if Reporting week (a) from table 1 is LT or EQ to Reporting week (b) from my calculated table but this sums all values whereas I only want to sum the latest value for each STORE KEY. I've tried using measures using MAX functions of the entry rank but have been unsuccesful. help please!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @v-lionel-msft 

 

I reposted this elsewhere because this topic was hidden for the first few days after posting as it was flagged for spam. 

 

 

Solution is here:

 

https://community.powerbi.com/t5/Desktop/Sum-the-latest-value-for-a-category-by-date/m-p/862739#M413...

View solution in original post

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

I think your problem is not easy to calculate by DAX, I think it's more easier to solve in EXCEL, then, you can import the data you calculated.
Best regards

Lionel Chen

Anonymous
Not applicable

Hi @v-lionel-msft 

 

I reposted this elsewhere because this topic was hidden for the first few days after posting as it was flagged for spam. 

 

 

Solution is here:

 

https://community.powerbi.com/t5/Desktop/Sum-the-latest-value-for-a-category-by-date/m-p/862739#M413...

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.