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
Anmolgan
Post Prodigy
Post Prodigy

How to Build A Dax to view data of all the months till data w.r.t all the years??

How can I build a DAX function which calculate all the data till date and compare that with the previous year which have the same months as till date, for example todays date is 5 April 2018, so if I select 2017 year inside the slicer I should be able to see a graph which show me the comparison b/w start of year i.e jan1 2018 to 5April 2018, and jan 1 2017 to 5 April 2017 with the previous year, currently I am using ytd but I think its calculating all the 12 months of data of all the years except the year 2018, where it shows me data from jan 1 to april 5. can anyone throw some light here

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi @Anmolgan,

 

Here are two examples for your reference:

Get the YTD of same period last year using DAX

YTD last year DAX

 

Regards,

Yuliana Gu

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

I have applied the dax written in the link into my enviroment but its giving me no result can you help me explain where am I doing wrong.

 

I dont know how to specify my months there so that it will look for those months in all years

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.