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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
santoshlearner2
Resolver I
Resolver I

Daily Balance of Stock in matrix instead of date slicer

Dear All,

 

My knowledge is not that great in power bi, learning from all you guys. I tried solving it but cannot get it. Higly appreciate for taking time to reply. Thank you every one. I have daily stock balance date wise, this is calculated based on the dates available. My issue is i can take get the daily balance but only if i use date as a slicer, if i want into matrix ie  product / day 1/ day 2  etc  it gives a blank results. Want result like this

 

Product02-06-202403-06-202404-06-202405-06-2024
Bike10257-2
Cycle130-55
Pen-41479
Car01569
Toy3024-28
Pencil-202210-2

 

Data is like this:

 

ProductDateUnit PriceStockDaily Sales Change
Bike31-05-202410100 
Cycle31-05-202420154 
Pen31-05-202430160 
Car31-05-202440210 
Toy31-05-202450230 
Pencil31-05-202460260 
     
Bike02-06-20241011010
Cycle02-06-2024201551
Pen02-06-202430156-4
Car02-06-2024402100
Toy02-06-20245026030
Pencil02-06-202460240-20
     
Bike03-06-20241013525
Cycle03-06-20242018530
Pen03-06-20243017014
Car03-06-20244022515
Toy03-06-20245028424
Pencil03-06-20246026222
     
Bike04-06-2024101427
Cycle04-06-202420180-5
Pen04-06-2024301777
Car04-06-2024402316
Toy04-06-202450282-2
Pencil04-06-20246027210
     
Bike05-06-202410140-2
Cycle05-06-2024201855
Pen05-06-2024301869
Car05-06-2024402409
Toy05-06-2024502908
Pencil05-06-202460270-2
1 ACCEPTED SOLUTION

Hi @santoshlearner2 ,

 

I made the following measure:

Daily Changes = VAR PD = CALCULATE(
			[Daily Stock],
			OFFSET(
				-1,
				ALLSELECTED('Daily Stocks'[Date]),
				ORDERBY(
					'Daily Stocks'[Date],
					ASC
				)
			)
		)
		RETURN
			IF(
				PD <> BLANK(),
				[Daily Stock] - PD
			)

MFelix_0-1719568656141.png

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

4 REPLIES 4
MFelix
Super User
Super User

Hi @santoshlearner2 ,

 

Not sure what is the issue that you are getting but having the information has you present when you had the data in a Matrix you can get the expected result:

MFelix_0-1719565313259.png

In this case I'm just adding the columns directly to the matrix visual.

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi,


Sorry the difference i get per day is as per a measure, the date columns has onlyt the numbers

 

Warm Regards

Santosh

Hi @santoshlearner2 ,

 

I made the following measure:

Daily Changes = VAR PD = CALCULATE(
			[Daily Stock],
			OFFSET(
				-1,
				ALLSELECTED('Daily Stocks'[Date]),
				ORDERBY(
					'Daily Stocks'[Date],
					ASC
				)
			)
		)
		RETURN
			IF(
				PD <> BLANK(),
				[Daily Stock] - PD
			)

MFelix_0-1719568656141.png

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi,

 

Thank you for your reply. i feel i am doing something wrong. not getting the result. I appreicate your reply. Your knowledge is vast in this.

 

Thanks

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors