PowerBI Convert this process to a measure so I can use filters?

ajamess

Board Regular
Joined
Sep 13, 2016
Messages
92
[FONT=&quot]I am fairly new to PowerBI and am working to complete the following goal. I have a large data set in the form of columns A
16x16_smiley-very-happy.png
and I would like to have a measure which calculates column H, which I could filter and graph on my report. [/FONT]

[FONT=&quot]
large
[/FONT]

[FONT=&quot] [/FONT]
[FONT=&quot]While playing around with PowerBI I was able to create this roughly (in a way that doesn't work with filters on the report), in 3 main steps. [/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]1) Weighted % Change Measure from raw data (In forms of columns A
16x16_smiley-very-happy.png
)[/FONT]

[FONT=&quot] [/FONT]
Code:
WeightedMeasure = (Sum(CurrentExtended)-Sum(PastExtended))/Sum(PastE<wbr style="box-sizing: inherit;">xtended)
[FONT=&quot]2) Creating a intermediate calculated table with unique date values and the related weighted monthly % change[/FONT]
Code:
Intermediate = distinct(Table1[Dates])
[FONT=&quot]and the calculated column : [/FONT]
Code:
WeightedChange = Calculate([WeightedMeasure])
[FONT=&quot] [/FONT]
[FONT=&quot]3) I then used a calculated column to create the Index: (Luckily how my data is formulated, the Dec-16 is included in the unique values when making the intermediate table, and returns with a blank entry in the weighted measure field.[/FONT]
Code:
Index = 100 * PRODUCTX ( filter (Intermediate, Intermediate[Dates] <= earlier(Intermediate[Dates])), Test[POS] + 1)
[FONT=&quot]This compounds the growth from the base of 100 for each month and comes out with the correct answer.[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]However, this calculated column (and I believe the use of the intermediate table entirely), does not allow report filters to affect this. So when I have 2 separate graphs on my report, one the WeightedMeasure over time, and one the Index over time. The WeightedMeasure reacts to report filters, however the Index does not.[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]How can I get the index as a measure which reacts to the filters?[/FONT]
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top