Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe 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
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
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.
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,
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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 40 | |
| 37 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 67 | |
| 34 | |
| 33 | |
| 30 |