custom column if statement based on excel cell value

Will85

Active Member
Joined
Apr 26, 2012
Messages
254
Office Version
  1. 365
Platform
  1. Windows
I am new to power query.

I have a query loaded into my workbook from a SQL database.
I have a pivot table pulling data from the query.
My query includes a column called Period, each record has a value that corresponds to the month that that the entry was made
I am trying to filter my pivot table based on period.
I am trying to control that filtering based on the cell value in sheet1 cell a1
I have 30 tabs, each with its own pivot table, so I am trying to filter all 30 at the same time instead of having to manually adjust each filter each month.

I want to add a custom column (which will then be included in my pivot table) that does an if statement.
If the value in my Period column of my query is less than or equal to the value in sheet1 cell a1, then I want my custom column to evalute to "include", if its false then "exclude"

Then I can include this custom column in my pivot tables, filter one time on "include" and then I imagine every time the value in cell a1 is updated, my data will refresh along with my custom column, and therefore my pivot tables.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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