Skip to content

Instantly share code, notes, and snippets.

@vdvoorder
vdvoorder / PreviewData.csx
Last active October 11, 2025 21:37 — forked from data-goblin/PreviewColumnsAndMeasures.csx
A Tabular Editor C# script to preview data for selected tables or columns and measures in the semantic model.
// Tabular Editor C# script to preview data for selected tables, columns and measures. Written by Ruben Van de Voorde, adapted from the original PreviewColumnsAndMeasures.csx by Kurt Buhler (https://gist.github.com/data-goblin/6ff37760cb35b793801c19a6a0ad73b0).
// * For >=1 tables, return row count per table
// * For >=1 columns from the same table, return distinct values and row count per combination
// * For >=1 measures, return the evaluated result per measure
// * For any combination of columns & measures, return distinct values per column combination and evaluated result
// Instructions
// ------------
// 1. Save this script as a macro with a context of 'Table', 'Column' and 'Measure'
// 2. Configure a keyboard shortcut for the macro if using Tabular Editor 3