Forum Discussion
Calucate Row with Matrix
- 6 years ago
Hi nicole1995 ,
We can use the following steps to meet your requirement:
- Create five measures that meets your row logic.
A subscription = CALCULATE(SUM(SubHeader[Subscription]),FILTER(SubHeader,SubHeader[Company]="A"))B inceptions - number of corporate = CALCULATE(COUNT(SubHeader[Subscription]),FILTER(SubHeader,SubHeader[SubStatus]="Current"&&SubHeader[Company]="B"))B inceptions - number of members = CALCULATE(COUNT(SubHeader[Members]),FILTER(SubHeader,SubHeader[SubStatus]="Current"&&SubHeader[Company]="B"))B premium = CALCULATE(SUM(SubHeader[Premium]),FILTER(SubHeader,SubHeader[Company]="B"))Incepted premium - total (B premium and A subscription) = [B premium] + [A subscription]- Then we can use Enter Date to create a new table that has one column based on the measures’ name.
- Create a measure in new table,
Row Measure = SUMX( VALUES('Table'[Row]), SWITCH( 'Table'[Row], "A subscription",[A subscription], "B premium",'SubHeader'[B premium], "Incepted premium - total (B premium and A subscription)",'SubHeader'[Incepted premium - total (B premium and A subscription)], "B inceptions - number of corporate",'SubHeader'[B inceptions - number of corporate], "B inceptions - number of members",[B inceptions - number of members]))- At last we can put the table[row] in the Row and table[Row Measure] in the Value.
We can get the result like this,
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
Best regards,
I've tried creating a basic measure which one of my rows would use and I get this -
after looking on google it suggested to use the formula but to create a table so i did that but once i add more than one table to the matrix it loses the structure i need
Hi nicole1995 ,
We can use the following steps to meet your requirement:
- Create five measures that meets your row logic.
A subscription = CALCULATE(SUM(SubHeader[Subscription]),FILTER(SubHeader,SubHeader[Company]="A"))
B inceptions - number of corporate = CALCULATE(COUNT(SubHeader[Subscription]),FILTER(SubHeader,SubHeader[SubStatus]="Current"&&SubHeader[Company]="B"))
B inceptions - number of members = CALCULATE(COUNT(SubHeader[Members]),FILTER(SubHeader,SubHeader[SubStatus]="Current"&&SubHeader[Company]="B"))
B premium = CALCULATE(SUM(SubHeader[Premium]),FILTER(SubHeader,SubHeader[Company]="B"))
Incepted premium - total (B premium and A subscription) =
[B premium] + [A subscription]
- Then we can use Enter Date to create a new table that has one column based on the measures’ name.
- Create a measure in new table,
Row Measure =
SUMX(
VALUES('Table'[Row]),
SWITCH(
'Table'[Row],
"A subscription",[A subscription],
"B premium",'SubHeader'[B premium],
"Incepted premium - total (B premium and A subscription)",'SubHeader'[Incepted premium - total (B premium and A subscription)],
"B inceptions - number of corporate",'SubHeader'[B inceptions - number of corporate],
"B inceptions - number of members",[B inceptions - number of members]))
- At last we can put the table[row] in the Row and table[Row Measure] in the Value.
We can get the result like this,
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
Best regards,