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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Khathu_King
Frequent Visitor

Stock On hand Balances last days for the week

Good day 

 

I need help, I am trying to create report where it will show me the Stock on Hand per las day of the week. I have two table one with Stock Codes,Description,Stock Link and Also Stock Transaction Table that have Transactions Date, and Stock Link,

 

The transactions on the The Stock Transaction table include the IN (GRV) and INV (Out) so I created a measure to find the stock on hand  by Taking INs (GRVs) Less Outs(INVs) 

 

I add Matrix table then then added the dates on Rows and stock Code and Description on the Column and Stock on hand on Value I am getting negative values in some rows but  there is no negative stock balance on the data , 

 

How can i solve this?

3 REPLIES 3
v-angzheng-msft
Community Support
Community Support

Hi, @Khathu_King 

Could you please consider sharing more details about it and posting expected result so it is clear on what needs to be implemented?  And It would be great if there is a sample file without any sesentive information here.

It makes it easier to give you a solution.

  1. Sample (dummy dataset) data as text, use the table tool in the editing bar
  2. Expected output from sample data
  3. Explanation in words of how to get from 1. to 2.

 

Best Regards,
Community Support Team _ Zeon Zheng

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

amitchandak
Super User
Super User

@Khathu_King ,

You can have measure like

This Week last day value = CALCULATE(lastnonblankvalues('Date'[Date],sum('Table'[Qty])) , FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))

 

 

You need rank column for week in date table

 

Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak 

The measure is giving incorrect results.please use below excel screen short to create Pbix file with the results maybe i missed a step 

 

 

Invteory MasterInvteory MasterStock TransactionStock Transaction

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.