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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
HEW
Helper III
Helper III

Bar chart - YTD figures

Hi.

 

We have a bar chart where we show YTD Current year, YTD last year and YTD budget figures.

 

However, for the actual YTD figures we would like only to show figures for the previous and currents months. This means that for May-December the red bar should be empty. Is this possible?

 

The measure for Actual YTD is:

Net sales Local YTD:=CALCULATE(SUM(Invoices[NetSalesLocal]);DATESYTD('Month'[Date])) 

 

 

Bar chart YTD.PNG

Thanks a lot in advance.

Br.

Helen

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@HEW 

First, you adjust the YTD to your financial year. Year from May -April will look like

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"4/30"))

Also you can stop it max date of data
YTD Sales =
var _max = maxx(Sales,Sales[Sales date])
return
CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"4/30"),Sales[Sales date]<=_max)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@HEW 

First, you adjust the YTD to your financial year. Year from May -April will look like

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"4/30"))

Also you can stop it max date of data
YTD Sales =
var _max = maxx(Sales,Sales[Sales date])
return
CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"4/30"),Sales[Sales date]<=_max)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

It works perfectly - thanks a lot.

 

Br.

Helen

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.