Forum Discussion
Anonymous
6 years agoNot applicable
Calculating Growth in a Matrix (adding a column)
Hi Hoping someone can help. I have some source data with thousands of records of events data including two columns which signify event segment and period. I've summarized these in a matrix and wish t...
- Anonymous6 years ago
Hi,
Please follow the steps below:
Step 1: Click on Enter data under Modeling tab and enter the following data:
Step 2:
Create the following measure:
Growth =VAR period1 =CALCULATE(SUM('Table'[Period Value]),FILTER('Table','Table'[Period] = "Period 1"))VAR period2 =CALCULATE(SUM('Table'[Period Value]),FILTER('Table','Table'[Period] = "Period 2"))VAR division =CALCULATE(DIVIDE(period2 - period1,period2,0))RETURNIF(SELECTEDVALUE(Category[Category]) = "Period 1",SUMX(FILTER('Table', 'Table'[Period] = "Period 1"), 'Table'[Period Value]),IF(SELECTEDVALUE(Category[Category]) = "Period 2",SUMX(FILTER('Table', 'Table'[Period] = "Period 2"), 'Table'[Period Value]),IF(SELECTEDVALUE(Category[Category]) = "Growth",FORMAT(division, "Percent"))))Step 3:In matrix visual, drag Category column from Category table under Columns.You can sort the Category column by creating index column and sort Category column based on index column.Regards,Vinay Dandwani
Anonymous
6 years agoNot applicable
Hi,
Please follow the steps below:
Step 1: Click on Enter data under Modeling tab and enter the following data:
Step 2:
Create the following measure:
Growth =
VAR period1 =
CALCULATE(
SUM('Table'[Period Value]),
FILTER(
'Table',
'Table'[Period] = "Period 1"
)
)
VAR period2 =
CALCULATE(
SUM('Table'[Period Value]),
FILTER(
'Table',
'Table'[Period] = "Period 2"
)
)
VAR division =
CALCULATE(
DIVIDE(
period2 - period1,
period2,
0
)
)
RETURN
IF(
SELECTEDVALUE(Category[Category]) = "Period 1",
SUMX(FILTER('Table', 'Table'[Period] = "Period 1"), 'Table'[Period Value]),
IF(
SELECTEDVALUE(Category[Category]) = "Period 2",
SUMX(FILTER('Table', 'Table'[Period] = "Period 2"), 'Table'[Period Value]),
IF(
SELECTEDVALUE(Category[Category]) = "Growth",
FORMAT(division, "Percent")
)
)
)
Step 3:
In matrix visual, drag Category column from Category table under Columns.
You can sort the Category column by creating index column and sort Category column based on index column.
Regards,
Vinay Dandwani
AlexDT
4 years agoFrequent Visitor
Hi Vinay,
If you have 36 periods, what way will you explore to show dynamic MTD and YTD vs pcp as last two colums?
Thank you!