Age Calculation in Power BI using Power Query

Поделиться
HTML-код
  • Опубликовано: 31 окт 2024

Комментарии • 40

  • @mohammadaamirkhan7830
    @mohammadaamirkhan7830 2 года назад

    Sound Interesting!
    Thanks for making an insightful video.

  • @charlenemarch3997
    @charlenemarch3997 2 года назад

    WOW this was a Huge time saver. Thank you! great video.

    • @RADACAD
      @RADACAD  2 года назад

      Glad it helped!

  • @tjiss7094
    @tjiss7094 3 года назад

    So useful especially for beginners of powerbi

  • @ssma1368
    @ssma1368 4 года назад

    Another interesting tutorial! Thanks Reza🙏

  • @mukkerasrikanth4848
    @mukkerasrikanth4848 Год назад

    Thank you for the clarification

  • @charlusmissier6135
    @charlusmissier6135 4 года назад

    Thanks a lot. The video solved a huge question I had

  • @stephaniewilson537
    @stephaniewilson537 3 года назад

    Just what I need to know...thank you!!

  • @aliazad1118
    @aliazad1118 4 года назад

    Perfect as usual...

  • @jeremyjerez5811
    @jeremyjerez5811 Год назад

    awesome! thanks a lot!!

  • @khurrammansoor9805
    @khurrammansoor9805 2 года назад

    Very Nice thank you

  • @PLBL
    @PLBL 4 года назад

    Hey. What if you have a date slicer on your dashboard and you need the age at a point in time? (e.g. I select the year 2013 and want to see their age distributions then). This method only gives the age they are right now.

  • @pieterjdw
    @pieterjdw 3 года назад

    Thanks! How would you create a frequency representation of the age. Would be even beter if you present it in age brackets

  • @sharatbabu7228
    @sharatbabu7228 Год назад

    Hi Sir, can u tell how can we calculate the upcoming birthdays in current week and next week.

  • @PLBL
    @PLBL 4 года назад

    Hey! What if you need the age to calculate dynamically based on a slicer on your dashboard. For example you have a slicer which changes the financial year of your report, and you have a graph showing age brackets of your workforce or something like that. You need the calculation find their age in that financial year, not their age today.

    • @RADACAD
      @RADACAD  4 года назад

      In that case, you need to calculate age through DAX. I have blog and video about that too

    • @signeflink27
      @signeflink27 Год назад

      @@RADACAD Hello. Could you please add link. Thanks advance!

  • @ashoklingutla2259
    @ashoklingutla2259 Год назад

    How to calculate age in direct query mode

  • @mathew9665
    @mathew9665 4 года назад

    As you note in a reply to Peter's comments - Do you have a solution that correctly deals with Date of Birth age calculations and the Leap Year issue?

    • @RADACAD
      @RADACAD  4 года назад +1

      The leap year issue is not a major issue of course, however, it can be easily fixed with a few more steps.
      let me first give you an example, so that you can understand what the issue is:
      let's say we have someone born on 1990, July 14th. and right now is Jan 2020. The age calculation returns 29, which is correct, even though we have leap years in between.
      what if that person born on 29th of Feb? then the same, age calculation would be right.
      The age calculation would be wrong only when the difference of the birthdate with the current date is less than or equal to the number of leap years between the two dates. for example, if someone born on 18th of Jan 1990, and we are calculating the age on 18th of Jan 2020, the age is 30, which is right. but if someone born on 25th of Jan 1990, even though today is 18th of Jan 2020, still it shows age as 30, because there are about 7 leap years, equivalent of 7 days in our calculation in between those dates.
      so as you can see, only with a few changes and adding a few more steps, you can get the calculated precisely if you want. I might do another video about it.

    • @DaxtasticNL
      @DaxtasticNL 4 года назад +1

      I would love to see the solution for Power Query also. In my opinion in Power Query it always goes wrong with calculations on ages with a birthdate where the day of birth is around the actual day of today. (see the posted picture in my previous comment). So for example someone was born on the 17th of january in a year and today it is the 17th of January 2020. So when you today check out the birthdates directly before or after the 17th of January of any year, there would be some wrong age calculations.
      If you have a solution in Power Query that would work perfectly, that would be great!

    • @RADACAD
      @RADACAD  4 года назад +1

      @@DaxtasticNL Hi Peter. Saying that "Power Query is always wrong with age" is not a correct analysis. Language is never wrong. we should understand what the function is doing, and if the function is not doing what it supposed to do, then yes, it is wrong.
      In our case; the TotalYears is just duration in days divided by 365, nothing more, nothing less. and it is calculating that value as expected.
      However, for calculating age in years, you expect some other considerations (the leap year is one example), in that case, if the language doesn't have the function for it, we can write one for it. No problem. and it is not complicated. I will post one soon, and you can see that it is working.

    • @RADACAD
      @RADACAD  4 года назад +1

      Here is how you can do it: ruclips.net/video/26WFCCwV6kc/видео.html

    • @DaxtasticNL
      @DaxtasticNL 4 года назад +2

      Hi Reza,
      I understand what you are saying, but in my opinion the "age-function" / "age-button" is not doing what I expect it would be doing. It's not giving me the age, but it is giving me a duration in days/minutes/hours/seconds. That's confusing in my opinion because that is not an age.
      But thanks again for your new great post and your quick solution for the "problem" 👍

  • @krishanakarmogili2303
    @krishanakarmogili2303 4 года назад

    I looking to group the age into 3 categories like 60, could you please share the link if you have

    • @RADACAD
      @RADACAD  4 года назад

      You can do that with adding a conditional column

  • @akramhemmat550
    @akramhemmat550 2 года назад

    Hi Dear, I need Formula for deferent ages E.g. : 0-5 , 6-18, 19-49, 50-60, 60-70, I need this formula to add it in the custom column when I am adding new custom column. Thanks.

  • @souhaildahmeni9961
    @souhaildahmeni9961 2 года назад

    Thanks

  • @isranim
    @isranim 4 года назад

    How to write query when you have to calculate ageing in days... For example there is a "Last working date" Is blank, and you have "date of joining"
    Like we write in excel = if(lwd) = "", today() - (doj), (lwd) -(doj)
    Similarly I have to find out the number of days people spent at workplace.

  • @laurentiuionutvita
    @laurentiuionutvita 3 месяца назад

    thanks

    • @RADACAD
      @RADACAD  2 месяца назад

      You're welcome!

  • @isranim
    @isranim 4 года назад

    How can we put this age slab... Say 0 to 20 has 2 people, 20+ to 40 has 4 people etc

    • @RADACAD
      @RADACAD  4 года назад

      You can use Group By transformation on a calculated column which is used for bands