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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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)

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)

@amitchandak 

It works perfectly - thanks a lot.

 

Br.

Helen

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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