• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

How to filter a measure|Power Pivot|Excel Forum|My Online Training Hub

You are here: Home / How to filter a measure|Power Pivot|Excel Forum|My Online Training Hub

vba course banner

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumPower PivotHow to filter a measure
sp_PrintTopic sp_TopicIcon
How to filter a measure
Avatar
Fred Jones

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
June 7, 2018
sp_UserOfflineSmall Offline
1
July 1, 2022 - 3:58 pm
sp_Permalink sp_Print
Note - this is a cross post from Mr Excel as I haven't has a response.
 
I just cannot work out how to do this so any help would be appreciated.

I have an account table (dim table): account name, start date, end date.
The user chooses a year using a disconnected 'year' slicer.
A measure [account status] calculates whether the account is 'active' or 'inactive' depending on the choice of 'year'.

This all works properly.

How do I create a report table showing only the 'active' accounts?

I have tried a powerpivot table with account name, start date and end date in the row field, and the [account status] in the 'values' field, but I cannot filter 'values' to only show 'active' (using the 'values filter' in the rows filed does not work with text, and I would prefer to use a slicer rather than the user having to faff around with filters on a pivot table).

Should I be using a powerpivot table or a different method?

Thanks

 
 
Avatar
Riny van Eekelen
Örnsköldsvik, Sweden
Moderator
Members


Trusted Members

Moderators

Power BI
Level 0
Forum Posts: 490
Member Since:
January 31, 2022
sp_UserOfflineSmall Offline
2
July 1, 2022 - 4:26 pm
sp_Permalink sp_Print

You omitted to add a link to your post on MrExel. Found it and added it below so that people answering on this forum can check if an answer has come in before spending time on it.

https://www.mrexcel.com/board/.....e.1209081/

It would be very helpful if you could share a file with some sample data, the measure and the pivot table.

Avatar
Fred Jones

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
June 7, 2018
sp_UserOfflineSmall Offline
3
July 3, 2022 - 2:39 pm
sp_Permalink sp_Print sp_EditHistory

@Riny Thanks for adding the link. I meant to do that but forgot. I have attached an example file so hopefully it helps with the question.

Avatar
Riny van Eekelen
Örnsköldsvik, Sweden
Moderator
Members


Trusted Members

Moderators

Power BI
Level 0
Forum Posts: 490
Member Since:
January 31, 2022
sp_UserOfflineSmall Offline
4
July 3, 2022 - 4:23 pm
sp_Permalink sp_Print

Why not use 1 and 0 to mark an account as Active and Inactive. Then you can filter Active accounts by selecting 1.

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 873
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
5
July 5, 2022 - 6:08 am
sp_Permalink sp_Print sp_EditHistory

Hello Fred,

Not sure if this is a good approach in the long run, but at least it works with this small amount of data, even though you have to update the data for every change. Take a look at the file and see if this little cheat trick does the job for you.

Br,
Anders

Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 648
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
6
July 5, 2022 - 7:51 pm
sp_Permalink sp_Print

You could use a measure just for active sales - eg

 

=CALCULATE([Total sales],FILTER(dimAccounts,[Year selected]>=max(dimAccounts[Year - start date])
&&[Year selected]<=max(dimAccounts[Year - end date])))

The following users say thank you to Velouria for this useful post:

Anders Sehlstedt
sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online:
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 216
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Melanie Ford
Isaac Felbah
Adele Glover
Hitesh Asrani
Rohan Abraham
Anthony van Riessen
Erlinda Eloriaga
Abisola Ogundele
MARTYN STERRY
Rahim Lakhani
Forum Stats:
Groups: 3
Forums: 24
Topics: 6356
Posts: 27793

 

Member Stats:
Guest Posters: 49
Members: 32324
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.