• 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
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Date count with blanks data |Power Pivot|Excel Forum|My Online Training Hub

You are here: Home / Date count with blanks data |Power Pivot|Excel Forum|My Online Training Hub
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 PivotDate count with blanks data
sp_PrintTopic sp_TopicIcon
Date count with blanks data
Avatar
Alexandra Begou

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
December 12, 2020
sp_UserOfflineSmall Offline
1
December 12, 2020 - 3:09 am
sp_Permalink sp_Print

Hi,

I am new to the forum so thank you in advance for answering my question. 

I made a power pivot and I would like to add a measure to calculate the number of days between two dates. 

I manage to try various options but nothing works. 

On a regular excel I will use the following: =IF(OR(ISBLANK([@[Profile Received]]),ISBLANK([@[Earliest Start Date]])), "",[@[Earliest Start Date]]-[@[Profile Received]])

Inside my power pivot, I tried the following: 

=SWITCH(TRUE(),'Data source'[Earliest Start Date]<'Data source'[Profile Received],-1*DATEDIFF('Data source'[Earliest Start Date],'Data source'[Profile Received],DAY),'Data source'[Earliest Start Date],'Data source'[Profile Received], DATEDIFF('Data source'[Profile Received],'Data source'[Earliest Start Date], DAY),0)

but following error messages Calculation error in measure 'Data source'[measure 1]: A single value for column 'Profile Received' in table 'Data source' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

I am not sure if I am correct or not and what type of aggregation to use. 

Thanks for your help

Alexandra

 

 

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4449
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
December 12, 2020 - 7:43 am
sp_Permalink sp_Print

Hi Alexandra,

Welcome to our forum!

It looks like you're writing a measure, when comparing to your Excel forumula, what you actually want to write is a calculated column?'

=SWITCH(TRUE(),'Data source'[Earliest Start Date]<'Data source'[Profile Received],-1*DATEDIFF('Data source'[Earliest Start Date],'Data source'[Profile Received],DAY),'Data source'[Earliest Start Date],'Data source'[Profile Received], DATEDIFF('Data source'[Profile Received],'Data source'[Earliest Start Date], DAY),0)

If you do intend to write a measure, then the section in red is most likely the issue because you're comparing a whole column of values to another whole column, when you need to return a single value. e.g. 

MIN('Data source'[Earliest Start Date])<MIN('Data source'[Profile Received])

That said, I'm not sure without seeing your file. If you can share a sample file with an extract of your data and an example of your desired result, we can help you further.

Mynda

Avatar
Alexandra Begou

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
December 12, 2020
sp_UserOfflineSmall Offline
3
December 12, 2020 - 9:34 pm
sp_Permalink sp_Print

Hi Mynda, 

I attached my sample file. 

I want to answer some question as, how long it took once we receive the profile and when the person started and also the turnover by role type. 

I have some blank in my file that my issue and I need to work around. 

Thank for the help. 

Alexandra 

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4449
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
4
December 13, 2020 - 1:37 pm
sp_Permalink sp_Print

Hi Alexandra,

Your example isn't clear, sorry. You have a PivotTable in the file, but I don't know what you're wanting to see specifically. You mention 'when a person started' but the PivotTable is at the Status level, not the staff member level.

Please provide a mockup example of your desired result and show how it relates back to the sample data. This will allow us to follow the audit trial to correctly understand what you want to do.

Thanks,

Mynda

Avatar
Alexandra Begou

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
December 12, 2020
sp_UserOfflineSmall Offline
5
December 16, 2020 - 3:16 am
sp_Permalink sp_Print

Hi Mynda, 

I think I am lost because I would like to do a Dashboard with my Data. 

I watched all your videos and I created some Dashboard in the past but on this one, I am blocked. 

I am trying to answer various questions but not sure how to handle it correctly mainly the turnover. 

What is the turnover, per type, per Role?

How to calculate the turnover, directly from the pivot with a measure or in the Power query editor. 

Thanks for your guidelines 

Alexandra

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4449
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
6
December 16, 2020 - 9:06 am
sp_Permalink sp_Print

Hi Alexandra,

Have you seen my HR Dashboard tutorial which covers how to calculate turnover using Power Pivot, which is where you should be calculating this information, as opposed to Power Query?

Mynda

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Kim Knox, Bhuwan Devkota
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 871
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
Jessica Stewart: 204
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Bhuwan Devkota
Kathryn Patton
Maria Conatser
Jefferson Granemann
Glen Coulthard
Nikki Fox
Rachele Dickie
Raj Mattoo
Mark Luke
terimeri dooriyan
Forum Stats:
Groups: 3
Forums: 24
Topics: 6221
Posts: 27285

 

Member Stats:
Guest Posters: 49
Members: 31909
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.