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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
smithshire
Frequent Visitor

Calculate the difference between calculated values in matrix visual

I have a matrix visual which displays a calculated measure of the total spend for each customer for the selected months.

The month names are derived from a calendar table.

I need to add an additional column to show the spend difference

 

CustomerFebruaryMarch
Test Customer 1£1,838.84£1,396.22
Test Customer 2£2,258.71£1,104.65
Test Customer 3£5,273.80£5,811.98
Test Customer 4£1,506.00£1,702.00

 

With difference :-

 

CustomerFebruaryMarchDifference
Test Customer 1£1,838.84£1,396.22-£442.62
Test Customer 2£2,258.71£1,104.65-£1,154.06
Test Customer 3£5,273.80£5,811.98£538.18
Test Customer 4£1,506.00£1,702.00£196.00

 

What would the best way to achieve this?

 

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@smithshire , these are measure then we create measure like

 

This moth Vs last month

 

MTD = CALCULATE(AverageX(values('Date'[Date]), calculate(SUM(Table[Qunatity Produced])) ),DATESMTD('Date'[Date]))

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]))

 

And we can take diff

 

 

Select Two period and take diff

How to use two Date/Period slicers

https://youtu.be/WSeZr_-MiTg

View solution in original post

2 REPLIES 2
smithshire
Frequent Visitor

's great - thanks.

amitchandak
Super User
Super User

@smithshire , these are measure then we create measure like

 

This moth Vs last month

 

MTD = CALCULATE(AverageX(values('Date'[Date]), calculate(SUM(Table[Qunatity Produced])) ),DATESMTD('Date'[Date]))

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]))

 

And we can take diff

 

 

Select Two period and take diff

How to use two Date/Period slicers

https://youtu.be/WSeZr_-MiTg

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.