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
PBI-Curious
Resolver I
Resolver I

Stacked Column Chart with PY and CY view

Hello PBI Community Good Day!

 

klsmith_dnb_1-1630620673784.png

 

I have a demo PBIX if that will help, please advise 

 

Thank you

 

klsmith_dnb_0-1630620638546.png

 

10 REPLIES 10
PBI-Curious
Resolver I
Resolver I

Hello Yingyinr

 

Here is my demo .pbix with an explanation of what Im trying to accomplish.

 

Please advise of any additional question.

 

Thank you for your time!

 

Regards,

 

https://drive.google.com/file/d/11bpKibDJiZE6w9E5ReSKGKyAfS0aicGL/view?usp=sharing

 

Anonymous
Not applicable

Hi @PBI-Curious ,

I can't download your file due to I have no proper permission... You can refer the method in the following link to share the file with me. Thank you.

yingyinr_0-1631093849035.png

Best Regards

Hello yingyinr

 

Please try again.

 

Thank you

Anonymous
Not applicable

Hi @PBI-Curious ,

I updated your sample pbix file(see attachment), please check whether that is what you want.

1. Create a measure as below to get the sum value for prior year

Sum of usage quality for prior year = CALCULATE(SUM('PBIXDD2'[usage quantity]),SAMEPERIODLASTYEAR('Calendar'[Date]))

2. Apply the above measure on Visual B to replace the original one

yingyinr_0-1631181713849.png

Best Regards

Hello yingyinr

I'm looking for a Stacked Column Chart per my example Tab - Attempt 2 Slicer B.  The issue I'm having is with Slicer B. Currently it's set at 8/1/2020 - 8/26/2021.  I would like to set it at 8/1/2021 - 8/26/2021 and it show me the prior year stack for 2020 with the Flag Yes and No). Is that possible? If I set the Slicer B to 8/1/2021 - 8/26/2021, I only get the Stacked Column Chart for 2021. I would like to see both - the Stacked Column Chart for 2020 with Flag ( Yes, No) and a Stacked Column Chart for 2021.

 

I can get it to work with a clusted column chart, but not with a stacked colunm chart.

Regards,

 

PBICurious_0-1631235888647.png

 

Anonymous
Not applicable

Hi @PBI-Curious ,

I updated your sample pbix file(see attachment) again with creating duplicated Attempt 2 Slicer B page, please check whether that is what you want.

1. Use the Date field in Calendar table on the slicer to replace the Date field in PBIXDD2 table

2. Delete the Flag field from Legend option

3. Apply the previous measure [Sum of usage quality for prior year] on the stacked column chart

yingyinr_0-1631697450682.png

Best Regards

Hello yingyinr

 

See my screen shot and my notes below....

 

I'm looking for the stacked column chart in the visual below with the flag in the legend.

PBICurious_0-1631826141070.png

 

I'm looking for a Stacked Column Chart per my example Tab - Attempt 2 Slicer B.  The issue I'm having is with Slicer B. Currently it's set at 8/1/2020 - 8/26/2021.  I would like to set it at 8/1/2021 - 8/26/2021 and it show me the prior year stack for 2020 with the Flag Yes and No). Is that possible? If I set the Slicer B to 8/1/2021 - 8/26/2021, I only get the Stacked Column Chart for 2021. I would like to see both - the Stacked Column Chart for 2020 with Flag ( Yes, No) and a Stacked Column Chart for 2021.

 

I can get it to work with a clusted column chart, but not with a stacked colunm chart.

Regards,

 

 

 

Also, I forgot to mention, I can get it to work with a cluster column chart with the dynamic slicer at the top. I'm trying to enhance the view with a stacked column chart adding the Flag (Yes and No) by year 2020 vs 2021 in a stacked column chart. More details in the attached .pbix.

PBI-Curious
Resolver I
Resolver I

Also took a different appoach using PY and CY dax measure, but the stacked column chart don't come out the same as the stacked column chart above.

 

klsmith_dnb_0-1630623475327.png

 

Anonymous
Not applicable

Hi @PBI-Curious ,

I'm not quite sure what you need. Do you want to apply two different slicers to filter the current year and previous year's values for the same period separately? Could you pleae share your demo pbix file with us? And explain the related scenario(backgroud and calculation logic etc.) and final expected result with specific examples. Thank you.

In addition, here are some links about comparing current year and previous year's values, you can refer to them.

CREATING A POWER BI CHART COMPARING EACH YEAR VS PREVIOUS YEAR

This Year VS Last Year Time Comparisons & Differences In Power BI

yingyinr_0-1630911718051.png

Best Regards

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.