Is it possible to Group by…Year?

  • Is it possible to Group by…Year?

    Posted by DSC Communities on November 25, 2019 at 10:45 am
    • GĆ©rard Ducouret

      Member

      November 25, 2019 at 10:45 AM

      Hello,
      i have a table with population By Country, by Gender, by Age group, by Year.
      I don’t care of Age group. I just want the total for each Gender for each Year. (AndĀ By Country)
      How can I do that?
      Thanks and regards

      Population by Gender , by Year, by age group

      ——————————
      GƩrard Ducouret
      ——————————

    • Christian ArltX

      Member

      November 25, 2019 at 11:11 AM

      Send me the file and I can do it. It’s actually easier to use PowerQuery (Group By) in excel

      ——————————
      Beau Arlt
      Business Analyst
      Holland MI
      989-400-7812
      ——————————
      ——————————————-

    • GĆ©rard Ducouret

      Member

      November 25, 2019 at 12:10 PM

      Hello,

      Here is the pbix file. Have a look at the Population-Combined query.
      Thanks a lot

      GƩrard

      ——————————
      GƩrard Ducouret
      ——————————
      ——————————————-

    • Christian ArltX

      Member

      November 25, 2019 at 12:37 PM

      I can’t actually complete the action.. it looks like there are some files on your desktop or in a folder on your computer that you are linked to… but since I don’t have them.. I can’t do it. Look at the other comment that said to use GrouBy in PowerQuery. Look up an example on Youtube and it should be pretty simple.

      ——————————
      Beau Arlt
      Business Analyst
      Holland MI
      989-400-7812
      ——————————
      ——————————————-

    • Audrey Abbey

      Member

      November 25, 2019 at 12:17 PM

      Gerard,

      There are several ways you can do this.

      If you just need a visual that shows this, then you can:
      Create a measure that sums the population.
      Then put Year, Gender, and/or Country on an axis.

      If you want to transform your table and remove the age attribute altogether:
      Go into the Query Editor (Edit Queries or Transform Data icon, depending on which version).

      In the query editor:
      Select Group By Transform.
      Click Advanced.
      Add a grouping for Year, Gender, and Country in the top section.
      Add an aggregation for Population using SUM in the bottom section.
      (Make sure your population column is set to decimal data type).

      This is what the Group By configuration window looks like with some example data I have.

      ——————————
      Audrey Abbey
      SR. BI Developer/Analyst
      LeapFrogBI
      Portland OR
      ——————————
      ——————————————-

    • GĆ©rard Ducouret

      Member

      November 27, 2019 at 10:14 AM

      Thanks a lot Audrey,
      With your help, I succeeded in this “Group by” šŸ™‚
      Thanks again

      ——————————
      GƩrard Ducouret
      ——————————
      ——————————————-

    DSC Communities replied 6 years, 4 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Is it possible to Group by…Year?’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!