Forum Discussion
Data slicing - multiple years
- Anonymous3 years ago
Hi ATYB9 ,
I updated your sample pbix file, please find the detailed steps in the attachment.
1. Unpivot Heading1~Heading5 columns of the query 'Merge1'
2. Create a period dimension table(Don't create any relationship with Merge1 table)
3. Update the formula of measure [SelectedYear] as below
SelectedYear = SELECTEDVALUE('Period Ends'[Period End])4. Create two measures to get the selected year and previous year heading values
CY_Headings = CALCULATE ( SUM ( 'Merge1'[Value] ), FILTER ( 'Merge1', 'Merge1'[Period End] = [SelectedYear] ) )PY_Headings = CALCULATE ( SUM ( 'Merge1'[Value] ), FILTER ( 'Merge1', 'Merge1'[Period End] = [PriorYearToSelectedYear] ) )PS: After you open the attachment, please update the data source file directory with yours for the query "Summary details" and "Draft position"...
Best Regards
Hi ATYB9 ,
I updated your sample pbix file, please find the detailed steps in the attachment.
1. Unpivot Heading1~Heading5 columns of the query 'Merge1'
2. Create a period dimension table(Don't create any relationship with Merge1 table)
3. Update the formula of measure [SelectedYear] as below
SelectedYear = SELECTEDVALUE('Period Ends'[Period End])
4. Create two measures to get the selected year and previous year heading values
CY_Headings =
CALCULATE (
SUM ( 'Merge1'[Value] ),
FILTER ( 'Merge1', 'Merge1'[Period End] = [SelectedYear] )
)PY_Headings =
CALCULATE (
SUM ( 'Merge1'[Value] ),
FILTER ( 'Merge1', 'Merge1'[Period End] = [PriorYearToSelectedYear] )
)
PS: After you open the attachment, please update the data source file directory with yours for the query "Summary details" and "Draft position"...
Best Regards