Power BI DAX measures written, explained and tested in filter context

par fidji Microsoft Copilot Anglais ~626 tokens
Extrait public Verrouillé
Model prerequisites first (marked date table, star schema, risky bi-directional filters), then base measures before derived ones, the measure itself, filter context explained line by line, ALL vs ALLSELECTED vs REMOVEFILTERS, a test matrix and the performance traps…

À propos de ce prompt

Describe the figure you need and paste your model (tables, columns, relationships): get the DAX measure with VAR / RETURN and DIVIDE, a plain-English explanation of what CALCULATE does to the filter context, the reason the total row may not equal the sum of rows, and a test matrix to prove the measure is right. Built for Microsoft Copilot users working alongside Power BI.

Exemple de résultat

Fourni par l'auteur
STEP 1 — Prerequisites Your Date table is not marked: Table tools → Mark as date table → Date[Date]. Without this, SAMEPERIODLASTYEAR can return wrong results when the relationship uses a datetime column. STEP 2 — Measures ```DAX Sales PY = // Sales of the same period one year earlier, following all current filters CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) ) Sales YoY % = VAR CurrentSales = [Total Sales] VAR PriorSales = [Sales PY] RETURN IF ( NOT ISBLANK ( PriorSales ), DIVIDE ( CurrentSales - PriorSales, PriorSales ) ) ``` Format: 0.0% STEP 3 — Explanation In the cell "March 2025 / North", the visual filters Date to March 2025 and Store to North. CALCULATE replaces only the Date filter with March 2024; the Region and Category filters stay… STEP 4 — Test plan Row "Total": YoY % is not the sum of monthly percentages, it is recomputed on the year — this is correct…

Fiche technique

Modèle
Microsoft Copilot
Langue du prompt
Anglais
Pour qui
Power BI report builders, finance and operations analysts who are past SUM but stuck on CALCULATE
Longueur
~626 tokens (estimation)
Format livré
Texte du prompt, affiché en ligne après achat

Avis

Réservés aux acheteurs

Aucun avis pour l'instant. Seuls les acheteurs de ce prompt peuvent en laisser un.

Signaler ce prompt