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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
miguesnet
Frequent Visitor

Stock Evolution by hours

Hello, 

 

I want to create a graph with stock evolution by time frame.

I have the following datas : 

miguesnet_0-1722755227563.png

I want to project stock in Power BI like this with stock evolution formula 

 

Stock = Stock start period + Prod - sales

miguesnet_2-1722755801042.png

 

Thanks a lot in advance for your help 

 

Mickael

1 ACCEPTED SOLUTION
mickey64
Super User
Super User

Step 0: I use your data below.

mickey64_0-1722761798795.png

 

Step 1: I add a 'Qty2' column and change data type of 'Qty2' column on Power Query Editor.

mickey64_1-1722761863818.png

 

Step 2: I make a 'M_Sum' measure.

M_Sum = CALCULATE(SUM(DATA[Qty2]),FILTER(ALLSELECTED('DATA'[Time Frame]),'DATA'[Time Frame]<=MAX('DATA'[Time Frame])))

 

Step 3: I make a slicer and a graph.

- Slicer -

mickey64_2-1722762075159.png

- Graph -

mickey64_3-1722762111080.png

 

View solution in original post

2 REPLIES 2
mickey64
Super User
Super User

Step 0: I use your data below.

mickey64_0-1722761798795.png

 

Step 1: I add a 'Qty2' column and change data type of 'Qty2' column on Power Query Editor.

mickey64_1-1722761863818.png

 

Step 2: I make a 'M_Sum' measure.

M_Sum = CALCULATE(SUM(DATA[Qty2]),FILTER(ALLSELECTED('DATA'[Time Frame]),'DATA'[Time Frame]<=MAX('DATA'[Time Frame])))

 

Step 3: I make a slicer and a graph.

- Slicer -

mickey64_2-1722762075159.png

- Graph -

mickey64_3-1722762111080.png

 

Thanks a lot for your Help Mickey 64

 

Mickael

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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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