Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

based on the year quarter previous year quarter value need

Hi all,

 

based on the year quarter previous year quarter value need

 

for example if i select 2020 Q3 i need result of 2019 Q3 value

 

i have used the measure = 

 

PY FY Actual rate netherland = ROUND(
CALCULATE (
SUM ( 'table'[Value] ),
FILTER (
ALL ( 'table' ),
'table'[Year]
= SELECTEDVALUE ( 'table'[Year] ) - 1
&& 'table'[business ] IN DISTINCT ( 'table'[business ] )
)
)/1000,0)
 
it's return correct previous year value but if i select filter it's not change it's shows only full previous year value only
 
 
how to achieve this logic?

 

 

 

 

 

 

2 REPLIES 2
gsherbon
Regular Visitor

If you have a Dates Table, then this can be done with the SAMEPERIODLASTYEAR function.

 

CY FY Actual rate netherland = ROUND( CALCULATE ( SUM ( 'table'[Value] ), )/1000,0)

 

PY FY Actual rate netherland = CALCULATE ( CY FY Actual rate netherland, SAMEPERIODLASTYEAR (DATES(Date))

 

Then whatever date slicer you pick will automatically calculate the same corresponding period.

amitchandak
Super User
Super User

@Anonymous , Based on what I got, please find the examples

 

if you have a date , then with date table and TI

QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
Last year same QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,Year)))
Last year same QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(ENDOFQUARTER(dateadd('Date'[Date],-1,Year))))

 

if you do not have Date, Based on rank on year Qtr or qtr start date

 

new column

Qtr Rank = RANKX(all('Date'),'Date'[Qtr Start date],,ASC,Dense)

or

Qtr Rank = RANKX(all('Date'),'Date'[year Qtr],,ASC,Dense)

 

measure
This Qtr = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Rank]=max('Date'[Qtr Rank])))
Last Qtr = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Rank]=max('Date'[Qtr Rank])-1))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.