Forum Discussion
Missing DateHierarchy N DateIntelligence. Calculate diff. btwn. same period this yr vs last yr.
- 7 years ago
Hi Anonymous
Create three measures
total value = CALCULATE ( SUM ( Table1[Sales ] ), FILTER ( ALLSELECTED ( Table1 ), Table1[Year] = MAX ( Table1[Year] ) && Table1[Period] = MAX ( Table1[Period] ) && Table1[Customer ] = MAX ( Table1[Customer ] ) ) ) LY = CALCULATE ( [total value], FILTER ( ALLSELECTED ( Table1 ), Table1[Year] = MAX ( Table1[Year] ) - 1 && Table1[Period] = MAX ( Table1[Period] ) && Table1[Customer ] = MAX ( Table1[Customer ] ) ) ) growth = IF([LY]<>BLANK(),([total value]-[LY])/[LY])Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - Anonymous7 years ago
Thank you! This is definitely useful but we are interested to understand why both the Date Hierarchy and Date Intelligence are missing as well. I figured out that it is due to we used "Direct Query" instead of "Import" when we are retrieving the data from the database. Both Date Hierarchy and Date Intelligence are available only when the raw data are retrieved through "Import".
Hi Anonymous
Create three measures
total value =
CALCULATE (
SUM ( Table1[Sales ] ),
FILTER (
ALLSELECTED ( Table1 ),
Table1[Year] = MAX ( Table1[Year] )
&& Table1[Period] = MAX ( Table1[Period] )
&& Table1[Customer ] = MAX ( Table1[Customer ] )
)
)
LY =
CALCULATE (
[total value],
FILTER (
ALLSELECTED ( Table1 ),
Table1[Year]
= MAX ( Table1[Year] ) - 1
&& Table1[Period] = MAX ( Table1[Period] )
&& Table1[Customer ] = MAX ( Table1[Customer ] )
)
)
growth = IF([LY]<>BLANK(),([total value]-[LY])/[LY])
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you! This is definitely useful but we are interested to understand why both the Date Hierarchy and Date Intelligence are missing as well. I figured out that it is due to we used "Direct Query" instead of "Import" when we are retrieving the data from the database. Both Date Hierarchy and Date Intelligence are available only when the raw data are retrieved through "Import".