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
Sachy123
Helper V
Helper V

Calculation on last value date,

SO I have data in the following format

DateTickerPrice
2020-11-30X20
2020-11-30Y5
2020-11-30Z2
2020-11-30A100
2020-10-30X10
2020-10-30Y15
2020-10-30Z20
2020-10-30A10

 

 

So I make a matrix view in my report and I see the following

DateXYZA
2020-11-302052100
2020-10-3010152010

 

 

Now I am trying hard to write a measure Perc_Change, that if dragged in the matrix view, should give me the percentage change from 

2020-10-30 to 2020-11-30 for that Asset.

 

DateXPerc_ChangeYPerc_ChangeZPerc_ChangeAPerc_Change
2020-11-3020100%5-66%2(2-20)/20100(100-10)/10
2020-10-30100%150%200%100%

 

Or is it better to do it in a Query view?

 

 

1 ACCEPTED SOLUTION
littlemojopuppy
Community Champion
Community Champion

Good morning!

 

Here's a couple measures...

Current Price:=AVERAGE(Tickers[Price])

Previous Price:=CALCULATE(
		[Current Price],
		PREVIOUSMONTH('Calendar'[Date])
	)

Price MTM Change:=[Current Price] - [Previous Price]

Price MTM % Change:=DIVIDE(
		[Price MTM Change],
		[Previous Price],
		BLANK()
	)

Using AVERAGE() because I'm not sure if you'll have more than one price in any given month.  If you do, you might want to change that to MIN(), MAX() or whatever suits your needs.

Results

littlemojopuppy_0-1608303388241.png

 

 

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Sachy123 , This month vs Last month for that with help of time intelligence and date table

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
this month =MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH('Date'[Date])))
last MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
previous month value = CALCULATE(sum('Table'[total hours value]),previousmonth('Date'[Date]))

 

diff = [MTD Sales]-[last MTD Sales]
diff % = divide([MTD Sales]-[last MTD Sales],[last MTD Sales])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

THANK YOU!

littlemojopuppy
Community Champion
Community Champion

Good morning!

 

Here's a couple measures...

Current Price:=AVERAGE(Tickers[Price])

Previous Price:=CALCULATE(
		[Current Price],
		PREVIOUSMONTH('Calendar'[Date])
	)

Price MTM Change:=[Current Price] - [Previous Price]

Price MTM % Change:=DIVIDE(
		[Price MTM Change],
		[Previous Price],
		BLANK()
	)

Using AVERAGE() because I'm not sure if you'll have more than one price in any given month.  If you do, you might want to change that to MIN(), MAX() or whatever suits your needs.

Results

littlemojopuppy_0-1608303388241.png

 

 

Forgot to mention...you'll have to have a date table because of the time intelligence function for this to work correctly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.