Forum Discussion
parallelperiod vs previousmonth vs adddate
- 10 years ago
Hi SHDJason,
In DAX, PARALLELPERIOD always returns full periods at the given granularity level instead of the partial periods that DATEADD returns. So please check if the dates in date column are continuous. If the dates in the current context do not form a contiguous interval, the function returns an error.
Reference:
PARALLELPERIOD Function (DAX)Regards,
Hi
All measures above are working well.
However am getting BLANK when i try to view this by stores/product/category.
Measure --> PPREVMONTH = CALCULATE([Volume],PREVIOUSMONTH('dim MS Cal'[Date]))
Thanks for your help or advise.
Thanks
Sami
- SamiTi8 years agoFrequent Visitor
Hi, The solution is that you need to select 1 month in order for measure to return Previous month value.
Hope this helps,
Sam
- Noak8 years ago
Helper IV
Hi SamiTi
I figured it our:
Parallel Period = VAR MinDate = MIN ( Date[Column] ) VAR StartDate = DATE ( YEAR ( MinDate ) - 1, MONTH ( MinDate ), DAY ( MinDate ) ) VAR MaxDate = MAX ( Date[Column] ) VAR EndDate = DATE ( YEAR ( MaxDate ) - 1, MONTH ( MaxDate ), DAY ( MaxDate ) ) RETURN CALCULATE ( [Measure], FILTER ( ALL ( DateColumn/Table ), Date[Column] >= StartDate && Date[Column] <= EndDate ) )
- Anonymous8 years agoNot applicable
Hi,
I have the same problem. I try to show sales by customers but PREVIOUSMONTH function gives me a blank column.
The PARALLELPERIOD function gives me a sum of the sales for last month AND last year last month. (August 2017 + August 2018).
The DATEADD function gives me the same result as the PARALLELPERIOD function.
These results are obviously not what I expect.
(Yes I do have a date table with a relationship between my date table and my sales table.)
Could someone help ?
Thank you
- SamiTi8 years agoFrequent Visitor
Hi,
Test on new page.
Create and Select from dropdown. August 2018
Create Table chart:
-Customer
-Sales measure.
-Sales Previous Month measure = July 2018.
Let me know if this helps
Thanks
Sam