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
Anonymous
Not applicable

based on selection cumulative total and previous year value show

Hi all,

 

I want to show previous year value and cummulative total in table fomat

 

i have source data year, month , i have concatenate year and month (Ex, September 2020),  if i select september 2020,  i need jan to sep2020 cummulative total value,  and previous year 2019 full year value 

 

sample data

 

YearMonthValueBusiness
2019jan73,431.49Allocated
2019april21,088.96Consumer
2019sep11,203.00Consumer
2019dec58.07Expenses
2020jan13,234.34Expenses
2020april75,690.32Allocated
2020sep17,817.28Consumer
2020Oct46.46Expenses
2018jan71,822.32Allocated
2018april18,293.38Consumer
2018sep69,064.75Expenses

 

 

 

if i select Sep2020,  i need cummulative total of jan2020 to sep2020 as a CY value ,  2019 jan to Dec value as a PY value

 

if i select Dec2019, i need cummulative total of jan to Dec2019 as a CY value then 2018 jan to dec as a PY value

 

output

 

snip.JPG

 

 

how can I achieve this logic?

 

@v-yingjl 

 

 

 

Thanks 

Rajesh

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try Time intelligence with date table

 

YTD Sales = CALCULATE(SUM(Table[Value]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Table[Value]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

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
lbendlin
Super User
Super User

Strangely enough SAMEPERIODLASTYEAR() will give you _exactly_ what you need. Normally that is a nuisance when you want to compare year over year to date, but in your case that seems to be your desired outcome (full previous year).

Helpful resources

Announcements
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!

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.