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

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

Reply
harirao
Post Prodigy
Post Prodigy

Grouping in Bar Graph Chart

Hi All,

I am working on a visualization, where i have to group below Y axis i.e "Weeks of Visibility" as mentioned below.

  • 0 to 23 weeks should be visible in graph
  • >6 months = Week 24 till 47
  • >12 months = Week 48 till 71
  • >18 months = Week 72 and above3.PNGCan we implement this in this above Bar Graph?

    Regards,
    Hari
1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi @harirao ,

 

Based on your description,I created a sample table as below:

Annotation 2020-05-28 130323.png

First create a calculated column to get week number:

 

Weeknum = WEEKNUM('Table (2)'[Date],2)

 

 Then create a calculted column per your request:

 

Column 2 = IF('Table (2)'[Weeknum]>=0&&'Table (2)'[Weeknum]<=23,""&'Table (2)'[Weeknum],IF('Table (2)'[Weeknum]>=24&&'Table (2)'[Weeknum]<=47,">6 months",IF('Table (2)'[Weeknum]>=48&&'Table (2)'[Weeknum]<=71,">12 months",IF('Table (2)'[Weeknum]>=72,">18 months",BLANK()))))

 

Finally you will see:

Annotation 2020-05-28 130729.png

Here is a sample .pbix file you can refer to.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

5 REPLIES 5
v-kelly-msft
Community Support
Community Support

Hi @harirao ,

 

Based on your description,I created a sample table as below:

Annotation 2020-05-28 130323.png

First create a calculated column to get week number:

 

Weeknum = WEEKNUM('Table (2)'[Date],2)

 

 Then create a calculted column per your request:

 

Column 2 = IF('Table (2)'[Weeknum]>=0&&'Table (2)'[Weeknum]<=23,""&'Table (2)'[Weeknum],IF('Table (2)'[Weeknum]>=24&&'Table (2)'[Weeknum]<=47,">6 months",IF('Table (2)'[Weeknum]>=48&&'Table (2)'[Weeknum]<=71,">12 months",IF('Table (2)'[Weeknum]>=72,">18 months",BLANK()))))

 

Finally you will see:

Annotation 2020-05-28 130729.png

Here is a sample .pbix file you can refer to.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
amitchandak
Super User
Super User

@harirao , create a column in your date table using today and you should able to get that

Like this example of month

Month Name =
var _mm= datediff([date],eomonth(today(),0),month)
return 
switch( true(),
_mm =0, "Current Month",
_mm =1, "Last Month",
format([Date],"MMM-YYYY")
)

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Appreciate your Kudos.

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak,

Thanks for your help, but i want Graph to look as mentioned below in Y axis

4.PNG

Please note i will be doing weekly selection.
5.PNG

Month Name =
var _mm= datediff([reportdate],eomonth(today(),0),month)
return
switch( true(),
_mm =0, "Current Month",
_mm =1, "Last Month",
format([reportdate],"MMM-YYYY")
)
Dax written for the above chart
Regards,
Hari 


 

@harirao Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@harirao ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.