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
ArpanJain
Frequent Visitor

current year & previous year &next year how to show value of year using dax

i am gettng error using dax previous year functioni am gettng error using dax previous year functionoutput that i require in previous y AND YEAR 2 columnoutput that i require in previous y AND YEAR 2 columnhi 

i want to get the value of previous year and next year in front of my date how to get this using dax.

please help.

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @ArpanJain ,

Is your problem solved? If so, would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirment will find the solution quickly and benefit here, thank you!

Best Regards,
Community Support Team _ kalyj

v-yanjiang-msft
Community Support
Community Support

Hi @ArpanJain ,

According to your description, you just want to get that which year is the previous year and next. If so, create calculated columns like this:

Previous year =
YEAR ( [Date] ) - 1
Next year =
YEAR ( [Date] ) + 1

Best Regards,
Community Support Team _ kalyj

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

Ashish_Mathur
Super User
Super User

Hi,

To your visual, drag Year and Quarter from the Calendar Table.  Write these measures.

Sales = sum(Data[Amount])

Sales in SPLY = calculate([sales],sameperiodlastyear(Calendar[Date]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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