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
hadjigeo
Helper I
Helper I

Calculate the performance of previous quarter.

Hi,

i need help on the below:

 

i am calculating the performance of the employees,with the below measure:

Performance = DIVIDE(SUM('PM Main JO'[Grand Total]),[Bonus Allocation])
so, if i have selected June and i want to show also the performance of June but also the performance of March how shall i do it? currently it shows only he performance of the selected month.
btw the column month is a text and not date
is there any possibility to store the performance of Q1,Q2,Q3,Q4 in different measures?
 
Untitled.png
Thanks in advance,
HH
1 ACCEPTED SOLUTION

try

Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),all(date[date]),DATESMTD(dateadd('Date'[Date],-1,QUARTER)))

 

In above all(date[date]), will remove filter on date

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

There are a few ways. Check these 2 , if they can work for you

 

#1
Last QTR= 
Var _last_QTR= (maxx('Date',ENDOFQUARTER(DATEADD('Date'[Date Filer],-1,QUARTER))))
Var _min_last_QTR= (MINX('Date',STARTOFQUARTER(DATEADD('Date'[Date Filer],-1,QUARTER))))

return
Var _last_year_val= CALCULATE(sum(Sales[Sales Amount]),(Sales[Sales Date])<=_last_QTR && (Sales[Sales Date]) >=_min_last_QTR)

#2
Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,QUARTER)))

 

 

Change -1 to -2,-3,-4 has per need to have additional qtr in past

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

@amitchandak 

 

am not getting any result because i have a slicer filter. if i remove the filter am getting the results, which i dont know how it calculated them.

 If possible please share a sample pbix file after removing sensitive information.
Thanks

its a huge file and its difficult to share as there a lot of sensitive info.

 

from what i understand, i need to remove the slicer filter from that measure. but i dont know how to do it.

try

Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),all(date[date]),DATESMTD(dateadd('Date'[Date],-1,QUARTER)))

 

In above all(date[date]), will remove filter on date

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.