Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Sagejah9
Helper III
Helper III

How to display count of persons in each tenure

Hi, I would like to create a graph like the one below qhich is showing the count of persons by tenure at a business firm. How can I get the x axis like this.  think I do have an idea of how to calculate the values by calculating the date difference between start date and end date for the number of years and do a count for earch xaxis series.  

 

Sagejah9_0-1630406662411.png

 

1 ACCEPTED SOLUTION
ziyabikram96
Helper V
Helper V

make barckets of your tnure like the following 

Bracker = 

SWITCH(
    TRUE(),
    Table3[Tenure] >=0 &&  Table3[Tenure] <= 1, "0-1",
    Table3[Tenure] > 1 &&  Table3[Tenure] <= 2, "1-2",
    Table3[Tenure] > 2 &&  Table3[Tenure] <= 5, "2-5",  
    Table3[Tenure] > 5 &&  Table3[Tenure] <= 10, "5-10",
    "> 10"
)

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@Sagejah9 

You can add a new column in your table as follows 

Fowmy_1-1630407930009.png

 

 

Create the following measure, add the new column to X axis and the measure to the value.

 

Fowmy_0-1630407916070.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

ziyabikram96
Helper V
Helper V

make barckets of your tnure like the following 

Bracker = 

SWITCH(
    TRUE(),
    Table3[Tenure] >=0 &&  Table3[Tenure] <= 1, "0-1",
    Table3[Tenure] > 1 &&  Table3[Tenure] <= 2, "1-2",
    Table3[Tenure] > 2 &&  Table3[Tenure] <= 5, "2-5",  
    Table3[Tenure] > 5 &&  Table3[Tenure] <= 10, "5-10",
    "> 10"
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.