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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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

2 ACCEPTED SOLUTIONS
johnt75
Super User
Super User
xifeng_L
Super User
Super User

Hi @amitpatra 

 

First, make a copy of the calendar table (without joining relationships with other tables), and then use the fields in the copied calendar table to replace the original x-axis.

 

Then, can try below measure in bar chart:

 

Measure = 
CALCULATE(
    SUM(Table[Value]),
    PARALLELPERIOD(Calendar[Date],0,YEAR),
    TREATAS(VALUES(Calendar_Copy[Date]),Calendar[Date])
)

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

View solution in original post

6 REPLIES 6
v-dineshya
Community Support
Community Support

Hi @amitpatra ,

If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards

Anonymous
Not applicable

Hi @amitpatra,

 

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

 

Regards,
Vinay Pabbu

Anonymous
Not applicable

Hi @amitpatra,

 

Thank you for reaching out to Microsoft Fabric Community Forum.

 

Create a new table with a Month-Year (MM-YYYY) column, ensuring it has no relationship with the fact table.

Then, Create a measure using the following DAX code.

 

=CLACULATE(SUM(Sales[Sale]),FILTER(Sales,Sales[YEAR]=SELECTEDVALUE('Calendar'[Year])))

 

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!


Regards,
Vinay Pabbu

Hi @amitpatra ,

If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards

xifeng_L
Super User
Super User

Hi @amitpatra 

 

First, make a copy of the calendar table (without joining relationships with other tables), and then use the fields in the copied calendar table to replace the original x-axis.

 

Then, can try below measure in bar chart:

 

Measure = 
CALCULATE(
    SUM(Table[Value]),
    PARALLELPERIOD(Calendar[Date],0,YEAR),
    TREATAS(VALUES(Calendar_Copy[Date]),Calendar[Date])
)

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

johnt75
Super User
Super User

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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