Forum Discussion

Rakesk13's avatar
Rakesk13
Icon for Advocate II rankAdvocate II
3 months ago
Solved

How to add two different age bucket from two different table

Hi team, i have two different table with two different age bucket like  Table 1:  Age       ID 0-5        10 5-10      20 50-60     5   Table 2:  Age       ID 0-5        30 5-10      60 1...
  • 123abc's avatar
    3 months ago

    Step 1:

    plese follow the link, i have solved the issue and save it in pbix file please download the pbix file:

     

    https://drive.google.com/file/d/1HqEY4DvldfpwOJ93Tlp1DHVpKSFuw58I/view?usp=sharing

     

    Go to power queries editors:

    Just to to home > append queries > append queries as New

    for append queries both tables name should be same, other wise tables not combine.

     

    > select table 1 and table 2

    > after append, use Group By IN Transform tab, extreme letf side click on "Group BY"

    > Group by: Age

    > New column : ID

    > Operation: Sum

    > Column: ID

    Out put wil be as you desired ... DOWNLOAD THE PBIX FILE IN GIVEN LINK.

     

    I hope this helps!
    If you found this answer helpful:
    Mark it as the solution to help others find it faster.
    Give it a kudo to show your appreciation!
    Thank you for being an awesome community member!

     

  • 123abc's avatar
    3 months ago

    Step: 2

    After step 1:  you have one more issue The sequence of your buckets: 

    The sequence of buckets: so follow the following steps and use following query formula:

    In power query editor click on Add Column > Click on custome column > In New column name.. give name > In cumtome column formula add given below formual > click on OK, and run the query.

     

    if [Age] = "0-5" then 1
    else if [Age] = "5-10" then 2
    else if [Age] = "11-20" then 3
    else if [Age] = "50-60" then 4
    else null

     

    Then click on Table View:

    click Sr. Number column

    click Column Tools

    click Sort by Column

    click Click Sr. Number 

    Go back to Report view.

     

    I hope this helps!
    If you found this answer helpful:
    Mark it as the solution to help others find it faster.
    Give it a kudo to show your appreciation!
    Thank you for being an awesome community member!