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

Monthly View from Weekly Data

Hi Everyone,

 

I've got stuck with a problem in converting from weekly data view to monthly.

 

I have a file that when on excel will work due to cell reference possibilities but not sure how to manage this on PowerBI.

 

The Formula weekly would be

([Stock for this week]/(([Sales for this week]+[Sales for Week+1])/2))*7

I created this by this measure in PowerBI

Week Calc. DOI = sum(Data[Stock])/
(sum(Data[Deliveries])+CALCULATE(sum(Data[Deliveries]),filter(all(Data[Week #]),Data[Week #]=(SELECTEDVALUE(Data[Week #])+1)))/2)*7
 
The Formula for the Monthly view is similar but would be
([Starting Stock for Month]/(([Total Sales for this Month]+[Total Sales for Month+1])/2))*30
 
The Issue I run into with this formula is that I only need the Stock from the 1st Week of the month, not the sum of all stock as its always weekly starting stock which adds onto each other. The total Sales for this Month and Month + 1 can be a sum of thie first row and the next row.
 
Can anyone help and give me advice on how to tackle this?
 
EDIT - Find the Data and PBIX file here
0 REPLIES 0

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.