Home > DAX > DAX – PARALLELPERIOD

DAX – PARALLELPERIOD

In any business domain, it is a common scenario to have tracking metrics to business progress i.e. technically comparison, variance and percentages.
We could solve a metrics scenario using DAX – Parallelperiod function and I think it covered detail explanation as well.

define 
measure 
'Internet Sales'[PresentYearInternetSales] = 
calculate(sum('Internet Sales'[Sales Amount]))

measure 
'Internet Sales'[PrevSales] = 
calculate(sum('Internet Sales'[Sales Amount]),parallelperiod('Date'[Date], -1, year))

measure 
'Internet Sales'[Variance] = 
'Internet Sales'[PresentYearInternetSales] - 'Internet Sales'[PrevSales]

measure 
'Internet Sales'[PercentVariance] = 
IF( ISBLANK('Internet Sales'[PrevSales]),BLANK(),('Internet Sales'[Variance]/'Internet Sales'[PrevSales]))

EVALUATE (
SUMMARIZE ( 'Internet Sales'
,'Date'[Calendar Year]
,"PresentYearInternetSales"
,format('Internet Sales'[PresentYearInternetSales],"currency")
,"PrevYearInternetSales"
, format('Internet Sales'[PrevSales],"currency")
,"Variance"
,format('Internet Sales'[Variance],"currency")
,"PercentageVariance"
,format('Internet Sales'[PercentVariance],"percent")
) 
)

Advertisements
Categories: DAX Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: