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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Lancelot
Frequent Visitor

YTD Total

Hi All

 

I need to get a year to date total not in an ordinary way:

 

YTD Profit =
var _numMonths = SELECTEDVALUE('Date'[Date].[MonthNo])
RETURN
CALCULATE([Profit After Tax]
                      ,VALUE(SELECTEDVALUE('Date'[Date].[Year])) = VALUE(YEAR('Trial Balance'[Period Date]))
                      ,SELECTEDVALUE('Date'[Date].[Month]) <= 'Trial Balance'[Month]
                      ,DATEADD('Date'[Date],-8,MONTH)
                    )
 
Based on the Month selected, I would like to know the month number and run the dateadd iteration that many times whhile I sum up the values.
 
Any suggestions will greatly be appreciated.
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Lancelot , You can have measure like

 

YTD Profit = CALCULATE([Profit After Tax],DATESYTD('Date'[Date],"12/31"))

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Lancelot , You can have measure like

 

YTD Profit = CALCULATE([Profit After Tax],DATESYTD('Date'[Date],"12/31"))

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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