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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
atp_2006
New Member

Custom Year To Date

Hello - 

 

I'm trying to create a custom Year to Date Calculation/Time Series.  

When I create the Custom Measures within Desktop it populates correctly. 

 

YTD = TOTALYTD(SUM(table[sales_amt]),Calendar[WK_END_DATE],"1/31")

 

But when I populate within Tabular Editor and change out the table/sales_amt with  "SelectedMeasure" I get errors/no results. 

any advice is appreciated.  Thank you. 

 

3 REPLIES 3
atp_2006
New Member

@amitchandak -

 

Thanks for you help. 

I've tried your way as well.  The Dax is accepted, but when I use the filter within the power bi tool it results in no data.

@amitchandak=

I'm able to hardcode the year with the result I'm expecting, but would like for it to be dynamic.

calculate(selectedmeasure(),'Calendar'[full_yr_nbr]="2022")

amitchandak
Super User
Super User

@atp_2006 ,

 

try like

calculate( Sum(Table[sales) ,datesytd(Calendar[Date],"1/31") ) // Make sue to use date of date Table

 

Create measures like

M1= Sum(Table[sales)

 

 

And create calculation group

 

calculate( selectedmeasures() ,datesytd(Calendar[Date],"1/31") )

 

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

 

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

 

 

Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.