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
Anonymous
Not applicable

How to display previous quarters data when i select this Quarter

When i select F19_Q2 i have to get previous quarters data not the one which i selected in the filter.

 

Can someone please help me on resolving the issue.

 

quarters data.PNG

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

If I understand your requirement correctly that your want to show the previous quarters data when select this Quarter.

 

If it is, here is a sample I created. I create a Date table with Calendar function and create the measure with below.

 

Measure = CALCULATE(SUM(Table1[Sales]),DATEADD('Date table'[Date],-1,QUARTER))

 

previous data.png

More details, please refer to the attachment.

 

If you still need help, please share your data sample and your desired output so that we could help further on it.

 

Best  Regards,

Cherry

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

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi   

The solution by   work well when comparing whole quarter, but in practice 90% of the time we want to compare a period parallel to the dates in the specified dates column. I will suggest you to use PARELLEPERIOD function instead of DATEADD or DATESBETWEEN .

 

 

 

Measure = CALCULATE(SUM(Table1[Sales]),PARELLEPERIOD('Date table'[Date],-1,QUARTER))

 

Regards,

Gaurav Raj Singh

 

 

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

 

 

 

 

Anonymous
Not applicable

@Anonymous 
but i dont have any calculation. Project detail is a simple Text.

 

Then why I need to use calculate.

v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

If I understand your requirement correctly that your want to show the previous quarters data when select this Quarter.

 

If it is, here is a sample I created. I create a Date table with Calendar function and create the measure with below.

 

Measure = CALCULATE(SUM(Table1[Sales]),DATEADD('Date table'[Date],-1,QUARTER))

 

previous data.png

More details, please refer to the attachment.

 

If you still need help, please share your data sample and your desired output so that we could help further on it.

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-piga-msft 

@GilbertQ 

I just want to display project which have been resolved last quarter from the current date.There is no calculation.

Can you please suggest how it can be done.

 

Example:

 

Project     Date resolved

A               20/01/2020

B                12/11/2019

C                11/10/2019

D                 11/06/2019

 

Then Output should be

B

C

Hi,

Are you OK with this?  You may download my PBI file from here.

Untitled.png


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

Hi @Anonymous ,

 

Make a new column and apply SWITCH and DATESBETWEEN function.

So it should be something like 

 

NewColumn = SWITCH(TRUE(), date < last quater first date && date > last quater last date...etc

 

Regards,

Gaurav 

Anonymous
Not applicable

Hi @v-piga-msft,

 

The DAX function which you have mentioned above is correct ... even i did the same.

 

But it is not working fine with data which i have.

 

Please find below the link for the pbix file and let me know how u can achieve the same.

 

https://drive.google.com/file/d/11XS6xMhopJslPYGr04ryPd3PrwwDav-k/view?usp=sharing

 

Regards,

Karthik S

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.