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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
harshadsp
Post Patron
Post Patron

Group at x-axis

Hi Experts,

Need your help! I have a table where I store crime and population in 2 different columns. The population has values like 13,15,17,19, 21,24,25 etc and its crimes are stored in correspondind crime column.

 

Now in bar chart of power bi, I need to dispay population on x-axis as <20, <30 and so on and the y-axis would have count of crimes with that population range.

 

Could any one advise how should I get this?

 

Thank you!

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @harshadsp,

 

In your scenario, you can open Query Editor, then create a custom column based on the condition <20, 20-30, 30-40, etc. Then group by this new column. Apply the change then back to the report.

 

q4.PNGq5.PNG

 

Create a calculated column to return actual count based on condition <20, <30,etc.

 

q6.PNGq7.PNG

 

For more information, you can download attached pbix file.

 

Best Regards,
QiuyunYu

 

 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-qiuyu-msft
Community Support
Community Support

Hi @harshadsp,

 

In your scenario, you can open Query Editor, then create a custom column based on the condition <20, 20-30, 30-40, etc. Then group by this new column. Apply the change then back to the report.

 

q4.PNGq5.PNG

 

Create a calculated column to return actual count based on condition <20, <30,etc.

 

q6.PNGq7.PNG

 

For more information, you can download attached pbix file.

 

Best Regards,
QiuyunYu

 

 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-qiuyu-msft , thank ou so much! All your afforts and time in this matter really appreciated! It worked as you have mentioned. Thanks for detailed screenshots as well.

 

Thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.