Forum Discussion

smithshire's avatar
smithshire
Frequent Visitor
4 years ago
Solved

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

  • 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

2 Replies

  • 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