If a measure of type: percent_of_total or type: running_total is used with a pivot, you can control the direction of the calculation using direction.
When pivoted, the default direction for these calculations is across the row. Sometimes users prefer the calculation to be performed down the column. This can be done by using direction: "column".
measure: running_order_total {
type: running_total
sql: ${order_total} ;;
direction: "row" # Calculation across the row (default)
}
measure: running_order_total {
type: running_total
sql: ${order_total} ;;
direction: "column" # Calculation down the column (row is default)
}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[],[],null,["# direction\n\n\u003cbr /\u003e\n\nUsage\n-----\n\n```\nview: view_name {\n measure: field_name {\n direction: \"row\"\n }\n}\n```\n\nDefinition\n----------\n\nIf a measure of `type: percent_of_total` or `type: running_total` is used with a pivot, you can control the direction of the calculation using `direction`.\n\nWhen pivoted, the default direction for these calculations is across the row. Sometimes users prefer the calculation to be performed down the column. This can be done by using `direction: \"column\"`. \n\n measure: running_order_total {\n type: running_total\n sql: ${order_total} ;;\n direction: \"row\" # Calculation across the row (default)\n }\n measure: running_order_total {\n type: running_total\n sql: ${order_total} ;;\n direction: \"column\" # Calculation down the column (row is default)\n }"]]