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
AishwariyaV
Helper IV
Helper IV

How to store previous year and quarter , next year and quarter values in measures

Hi,

 

Do anyone have idea on how to store the previous year value and previous quarter value & next year value and next quarter value from current date in measure.

 

Tried using previousyear and previousquarter dax functions. It doesn't work according to my need.

 

Please help.

 

Thanks in advance.

4 REPLIES 4
v-janeyg-msft
Community Support
Community Support

Hi, @AishwariyaV 

 

I recommend you check the post first:How to Get Your Question Answered Quickly - Microsoft Power BI Community

Your requirement is simple to achieve, But you need to share some sample fake data and how you want to display it in the report. So we can help you soon.

 

Best Regards

Janey Guo

 

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

PhilipTreacy
Super User
Super User

Hi @AishwariyaV 

Have you got sample data?  Please show your tables.  Or a PBIX file?

Is the year text or a number?  Are you using a Date Table?  How have you created the quarters e.g. Q4 etc?

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


PhilipTreacy
Super User
Super User

Hi @AishwariyaV 

You haven't provided any sample data so any answer you get will be a general one.  You haven't said what values you are trying to calculate.  Nobody can write DAX for you that won't need changing, without knowing the structure of your data.

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi @PhilipTreacy 

Current year = 2021

current qtr = Q1

IFNULL(SUM((CASE
                        WHEN
                        (Quarter = 'Q4' {Prev qtr from current date} AND Year = '2020' {Prev year from current date})
                        THEN Sales END)), 0) AS Sales_For_PrevQtr

This is the calculation i am trying to bring in power bi

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.