Forum Discussion
Creating a dynamic summarization table based on measure values
- 2 years ago
Hi HeevaCh ,
You can try this solution.
Step 1: Use the following table expression to create an auxiliary table of customer categories to be used as row label fields.
CustomerCategory = DATATABLE ( "Category",STRING, "Index",INTEGER, { {"Key",1}, {"Uncertain",2}, {"Frequent",3}, {"Spender",4} } )Step 2: Create a measure named # Clients.
# Clients = VAR TempTable = ADDCOLUMNS ( ALL ( 'Client'[Client] ), "Status", [LRFM Analysis LRFM] ) RETURN SUMX ( VALUES ( 'CustomerCategory'[Category] ), COUNTROWS ( FILTER ( TempTable, [Status] = 'CustomerCategory'[Category] ) ) )Step 3: Use the category field of the CustomerCategory table created earlier as the matrix row label and the # Clients measure as the value field of the matrix. Then you can get the results you want.
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
Hi HeevaCh ,
You can try this solution.
Step 1: Use the following table expression to create an auxiliary table of customer categories to be used as row label fields.
CustomerCategory =
DATATABLE (
"Category",STRING,
"Index",INTEGER,
{
{"Key",1},
{"Uncertain",2},
{"Frequent",3},
{"Spender",4}
}
)
Step 2: Create a measure named # Clients.
# Clients =
VAR TempTable =
ADDCOLUMNS ( ALL ( 'Client'[Client] ), "Status", [LRFM Analysis LRFM] )
RETURN
SUMX (
VALUES ( 'CustomerCategory'[Category] ),
COUNTROWS ( FILTER ( TempTable, [Status] = 'CustomerCategory'[Category] ) )
)
Step 3: Use the category field of the CustomerCategory table created earlier as the matrix row label and the # Clients measure as the value field of the matrix. Then you can get the results you want.
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
Thanks!