cancel
Showing results for
Did you mean:
Highlighted
Anonymous
Not applicable

## Difference and index column in matrix with slicer

Hi,

I would like to create a measure which calculate the difference of 2 columns in a matrix and chance according to the slicer selections.

I have read some other topics, however it seems very specific for every case and I can't find a solution for mine.

My report page:

The data which forms the numbers looks as follows:

 Customer product group product date Value 10023 10 101540 6.7.2018 19,5 10023 10 101540 15.7.2018 58,5 10023 10 102560 6.7.2018 19,5

Now I would like to add 2 columns that calculate the difference of the numbers in the table.

As follows:

 2017 2018 Difference Index 10836797,24 12500320,78 1663523,54 115,4 779662,79 789100,60 9437,81 101,2 994985,29 1058116,88 63131,59 106,3 278138,70 325577,87 47439,17 117,1 6531291,03 6597573,42 66282,39 101,0

Difference = 2018 - 2017

Index = 2018 / 2017

Hope someone can help me out.

Kind regards,

Guido

1 ACCEPTED SOLUTION

Accepted Solutions
Established Member

## Re: Difference and index column in matrix with slicer

I saw you have a calendar table

Create these measures:

SumofValue = Sum(Table[Value])

SumOfValuePrevYear = Calculate([SumofValue];SAMEPERIODLASTYEAR(Calendar[date])

Difference = [SumofValue] - [SumOfValuePrevYear]

2018/2017 = [SumofValue] / [SumOfValuePrevYear]

Hope this help.

5 REPLIES 5
Established Member

## Re: Difference and index column in matrix with slicer

I saw you have a calendar table

Create these measures:

SumofValue = Sum(Table[Value])

SumOfValuePrevYear = Calculate([SumofValue];SAMEPERIODLASTYEAR(Calendar[date])

Difference = [SumofValue] - [SumOfValuePrevYear]

2018/2017 = [SumofValue] / [SumOfValuePrevYear]

Hope this help.

Anonymous
Not applicable

## Re: Difference and index column in matrix with slicer

Hi @sokg

It works, however I get the difference 2 times:

Do you have an idea how to fix this?

Kind regards,

Guido

Established Member

## Re: Difference and index column in matrix with slicer

Try select one year only (i.e. 2018)

Anonymous
Not applicable

## Re: Difference and index column in matrix with slicer

Hi @sokg

That would be an option, however the desired format would be:

 2017 2018 Difference Index 10836797,24 12500320,78 1663523,54 115,4 779662,79 789100,60 9437,81 101,2 994985,29 1058116,88 63131,59 106,3 278138,70 325577,87 47439,17 117,1 6531291,03 6597573,42 66282,39 101,0

Any idea how we could create this?

Regards

Anonymous
Not applicable

## Re: Difference and index column in matrix with slicer

Hi @sokg

Found a solution. Made 2 seperate measures in stead of using "Year" in Kalender table

Announcements

#### Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

#### Community News & Announcements

Get your latest community news and announcements.

#### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 48 members 943 guests
Recent signins: