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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Optimusprime_25
Resolver I
Resolver I

Difference between PY and CY in Bar Chart

Hi team,

 

We have a requirement where we have to display difference between PY and CY bars as data label in a bar chart. We are stuck at this point. If anyone have any points please let me know.

 

Optimusprime_25_0-1676006832882.png

I have created below chart, unable to proceed further.

 

Optimusprime_25_1-1676006897792.png

 

Thanks in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Optimusprime_25 ,

I have created a simple sample, please refer to my pbix file to see if it helps you.

Create a measure to calculate the difference.

Measure = VAR _1=SUMX(FILTER(ALL('Table'),'Table'[subject]="CY"&&'Table'[date]=SELECTEDVALUE('Table'[date])),'Table'[VALUE])
VAR _PY=SUMX(FILTER(ALL('Table'),'Table'[subject]="PY"&&'Table'[date]=SELECTEDVALUE('Table'[date])),'Table'[VALUE])
RETURN
_PY-_1

Then choose the Line and clustered column chart.

Put the measure to the Line y-axis.

Next select Format your visual>>Data label>>Series.

vpollymsft_0-1676253567750.pngvpollymsft_1-1676253581562.pngvpollymsft_2-1676253595608.png

 

Finally adjust the stroke width to 0 px.

vpollymsft_3-1676253626846.png

vpollymsft_4-1676253677822.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Optimusprime_25 ,

I have created a simple sample, please refer to my pbix file to see if it helps you.

Create a measure to calculate the difference.

Measure = VAR _1=SUMX(FILTER(ALL('Table'),'Table'[subject]="CY"&&'Table'[date]=SELECTEDVALUE('Table'[date])),'Table'[VALUE])
VAR _PY=SUMX(FILTER(ALL('Table'),'Table'[subject]="PY"&&'Table'[date]=SELECTEDVALUE('Table'[date])),'Table'[VALUE])
RETURN
_PY-_1

Then choose the Line and clustered column chart.

Put the measure to the Line y-axis.

Next select Format your visual>>Data label>>Series.

vpollymsft_0-1676253567750.pngvpollymsft_1-1676253581562.pngvpollymsft_2-1676253595608.png

 

Finally adjust the stroke width to 0 px.

vpollymsft_3-1676253626846.png

vpollymsft_4-1676253677822.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

Thanks @Anonymous  for your prompt response.

It has  worked, we have done few modifications from our end.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.