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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
amitpatra
New Member

Show data for all 12 months of selected slicer Year-Month value in bar chart

Hello,

 

I want to show the data for whole year for all the bars in a bar chart from Jan-Dec for the selected month-Year in slicer.

 

For e.g., if I select Feb-2025 in slicer, bar chart should show bars data from Jan-2025 to Dec-2025.

 

Any idea or suggestion is highly appreciated.

 

Thanks,

Amit

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

I have answered a similar question in the attached PBI file.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-sgandrathi
Community Support
Community Support

Hi @amitpatra ,

Thankyou for using Microsoft Fabric Community Forum and Thank you @TomMartens and @DataNinja777 for your response.
I wanted to check if you had the opportunity to review the information provided by the community members. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

Hi @amitpatra,


we haven't heard back from you regarding our last response and wanted to check if your issue has been resolved.

If our response addressed by the community member for  your query, please mark it as Accept Answer and click Yes if you found it helpful.

Should you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!

Hi @amitpatra,

Thank you @Ashish_Mathur for your response to the query.

 

May I ask if you have gotten this issue resolved?

If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.

 

Thank you.

DataNinja777
Super User
Super User

Hi @amitpatra ,

 

To show data for all 12 months of the selected year based on a slicer that uses Year-Month (e.g., Feb-2025), you need to decouple the slicer's effect from the chart and instead use the selected value only to extract the year. This way, your bar chart will always show January to December of the selected year, regardless of the specific month chosen.

Assuming your slicer is based on a YearMonth column formatted as "MMM-YYYY", you can create a measure to extract the selected year. Here's an example:

SelectedYear =
VALUE(RIGHT(SELECTEDVALUE('Calendar'[YearMonth]), 4))

Once you have the selected year, you can create another measure to calculate the values for all 12 months of that year. Suppose you're working with a Sales table and summing the Sales[Amount], the measure would look like this:

Sales in Selected Year =
VAR YearSelected = [SelectedYear]
RETURN
CALCULATE(
    SUM(Sales[Amount]),
    FILTER(
        ALL('Calendar'),
        'Calendar'[Year] = YearSelected
    )
)

Use this measure in your bar chart, setting the X-axis to 'Calendar'[Month] or 'Calendar'[Month Name], sorted correctly by month number. The slicer will still let users choose a specific Year-Month, but the chart will show the full year based on the year extracted from that selection.

 

Best regards,

TomMartens
Super User
Super User

Hey @amitpatra ,

 

I recommend reading these articles:

Then, create a Date/Calendar dimension table, build a relationship between the "fact" table and the calendar table and use the Year from the Calendar table in the slicer and the month from the calendar table for the axis of the bar chart.

 

Hopefully, this helps to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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