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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
shalini13
Regular Visitor

Quarter data display in bar chart

hi ,

 

I want to display cumulative quarter wise data for the selected quarter in the slicer along with the previous quarter. for an instanace, if i select Q2, then the total sales value for the Q1 & Q2 has to be displayes in the bar chart. Here I used calendar table for slicer. 

this is the dax, i used, 

cumm_bar = CALCULATE
(
           COUNTROWS(PurchaseOrder),
            FILTER
            (
              ALL( CalendarTable),
              CalendarTable[Quarter] <= MAX(CalendarTable[Quarter])
              && CalendarTable[Year] = MAX(CalendarTable[Year])
)). 
in this case, i always get the value for the quarter that i select in the slicer not for the previous ones. please help. TIA.
11 REPLIES 11
Anonymous
Not applicable

Hi @shalini13 ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please feel free to let me know.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Ahmedx
Super User
Super User

for it to work for you, you must create an unrelated table like I have in the "Slicer" file
and use it for slicing

Screenshot_4.pngScreenshot_5.png

If i use a disconnected table then it does but my other charts  get affected. here is my file https://drive.google.com/file/d/1ri8pLxdwQ5dLQFgUUDBTDYW4MsKWcUFP/view?usp=drive_link 

with an active connection it will not work

Is there any other way to approach so that other charts in the page will not get affected. TIA

you need to change the RELATION to inactive and change all the measures that are associated with them and activate them using USERELATIONSHIP

https://www.sqlbi.com/articles/show-previous-6-months-of-data-from-single-slicer-selection/

Ahmedx
Super User
Super User

Screenshot_2.pngScreenshot_3.png

This solution doesnt work for me  . i am getting bar only for the selected quarter. 

shalini13
Regular Visitor

Hello ahmed,

 

 can i know how the key is created and a brief explanation about it. please.

Ahmedx
Super User
Super User

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Screenshot_2.png

i am looking for similar output. let me try and came back. thanks a ton

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Solution Authors