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
Pbi07
Helper V
Helper V

Issue with Totals with Fiscal Year

Having some issue with my Totals. Something simple that i am missing out. 

 

Need to get the 3 totals based on fiscal Year which starts May 1st. I had my measures as below. But i am not getting totals by the sites for some reason. 

Year To date totals

cytd Total = TOTALYTD([Total Amount],'Calendar'[Date],"04/30")

Last Year Totals 

Last Year Total = TOTALYTD([Total Amount],SAMEPERIODLASTYEAR('Calendar'[Date]),"04/30")

Current Year Total -  

CY Total Amount = sum('Fact'[Amount]). 
 
Need to get the Last Year Totals & Current Year totals to be able to slice based on the period selection. My understanding is TOTALYTD will get the totals upto the period selected on slicer. 
 
But i want to get the LAst Year Total & Current Year Totals based on the selected Period. In other words if i select only 1, 2 & 3 it should be totals for first 3 periods for the year and last year same period. 
 
 
Attached is the model 

 

 

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @Pbi07 ,

As checked your file, the data type of field Date in fact table be set as Text, so it should be the cause that can't get the total values. Please select Date field and navigate to Column tools ribbon to set the data type of Date field as "Date" just as below screenshot:

TotalYTD.JPG

Best Regards

Community Support Team _ Rena
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

4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

Hi @Pbi07 ,

As checked your file, the data type of field Date in fact table be set as Text, so it should be the cause that can't get the total values. Please select Date field and navigate to Column tools ribbon to set the data type of Date field as "Date" just as below screenshot:

TotalYTD.JPG

Best Regards

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

Thanks @v-yiruan-msft . Super. I should've caught that. 

amitchandak
Super User
Super User

@Pbi07 , Try like

 

Last YTD Sales = CALCULATE([Total Amount],DATESYTD(dateadd('Date'[Date],-1,Year),"4/30"))

 

You can add custom period and add that to slicer

refer my calndar Creating Financial Calendar - From Any Month
https://community.powerbi.com/t5/Community-Blog/Creating-Financial-Calendar-Decoding-Date-and-Calend...

 

example

YTD= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year]) && 'Date'[Period] <= Max('Date'[Period]) ))
LYTD = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year])-1 && 'Date'[Period] <= Max('Date'[Period])))

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

Thanks @amitchandak .  I will try those measures. is that a right statement, that For the current year, i don't need a filter checking max date even if fiscal year starts 05/01  

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.