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
JoaoPvP
Frequent Visitor

Cumulative - empty for months with no data

Hello,

 

I'm trying to get a cumulative overview of the last 3 years using the following measure:

 

Voyages_agg_test = CALCULATE( COUNT(CE[Voyage]); FILTER( ALL('Calendar'); AND( 'Calendar'[Date] <= MAX(CE[COD]) ; YEAR('Calendar'[Date]) = YEAR( MAX('Calendar'[Date]) )) ))
 
 

Working well except for the month where I have no voyage, i.e., September. The information from 2017 is missing. 

Voyages.PNG
 
Any idea what can be causing this?
 
Thank you,
João
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@JoaoPvP , If you are using Year = max( year) Than is as good YTD ??

Voyages_agg_test = CALCULATE( COUNT(CE[Voyage]); FILTER( ALL('Calendar'); AND( 'Calendar'[Date] <= MAX(CE[COD]) ; YEAR('Calendar'[Date]) = YEAR( MAX('Calendar'[Date]) )) ))

 

Try like

Voyages_agg_test = CALCULATE( COUNT(CE[Voyage]); FILTER( ALL('Calendar'); AND( 'Calendar'[Date] <= MAX('Calendar'[Date] ) ; YEAR('Calendar'[Date]) = YEAR( MAX('Calendar'[Date]) )) )

 

because when COD is not there it will fail

you can have filter to stop at max cod value

 

like

Voyages_agg_test =
var _max = MAXX(allselected(CE),CE[COD])
return
CALCULATE( COUNT(CE[Voyage]); FILTER( ALL('Calendar'); 'Calendar'[Date] <= MAX('Calendar'[Date] ) && YEAR('Calendar'[Date]) = YEAR( MAX('Calendar'[Date]) &&
'Calendar'[Date] <= _max) ) )

 

For YTD refer : YTD Questions — Time Intelligence 1–5
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a

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

4 REPLIES 4
amitchandak
Super User
Super User

@JoaoPvP , If you are using Year = max( year) Than is as good YTD ??

Voyages_agg_test = CALCULATE( COUNT(CE[Voyage]); FILTER( ALL('Calendar'); AND( 'Calendar'[Date] <= MAX(CE[COD]) ; YEAR('Calendar'[Date]) = YEAR( MAX('Calendar'[Date]) )) ))

 

Try like

Voyages_agg_test = CALCULATE( COUNT(CE[Voyage]); FILTER( ALL('Calendar'); AND( 'Calendar'[Date] <= MAX('Calendar'[Date] ) ; YEAR('Calendar'[Date]) = YEAR( MAX('Calendar'[Date]) )) )

 

because when COD is not there it will fail

you can have filter to stop at max cod value

 

like

Voyages_agg_test =
var _max = MAXX(allselected(CE),CE[COD])
return
CALCULATE( COUNT(CE[Voyage]); FILTER( ALL('Calendar'); 'Calendar'[Date] <= MAX('Calendar'[Date] ) && YEAR('Calendar'[Date]) = YEAR( MAX('Calendar'[Date]) &&
'Calendar'[Date] <= _max) ) )

 

For YTD refer : YTD Questions — Time Intelligence 1–5
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a

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

Hi,

 

Used 

Voyages_agg_test = CALCULATE(count(CE[Voyage]);DATESYTD('Calendar'[Date]))
 
Had no idea that Datesytd existed. Marking your reply has right since the documentation you are mentioning has a path to this.
 
Thank you.
andre
Memorable Member
Memorable Member

What is the desired behaviour? It's not clear from your chart what is wrong..

JoaoPvP
Frequent Visitor

Hi Andre,

 

I would like to have a bar in September 2017, which is missing from the chart.

 

Thank you,

João

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
Top Kudoed Authors