WMA Hub

DAX formula library

Copy-ready DAX patterns, each with an explanation, the model assumptions it needs and the mistakes to avoid.

  • Actual vs target variance and attainment

    Actual vs target · Beginner

    Show how far actual sales are above or below target, as a percentage of target.

  • Contribution % of total

    Contribution & share · Beginner

    Show each row as a percentage of the total of everything the user has selected.

  • Dynamic title from the selected years

    Dynamic titles & labels · Beginner

    Build a chart title that changes with the slicer, such as "Sales for 2023, 2024".

  • Selected value label with a fallback

    Dynamic titles & labels · Beginner

    Show the selected region (or any column value), or a friendly default when none or several are selected.

  • Keep slicer selections with KEEPFILTERS

    Filter context · Advanced

    Calculate a value for one category without overriding what the user selected in a slicer.

  • Remove a filter with REMOVEFILTERS

    Filter context · Intermediate

    Calculate a value that ignores one table's filters, for example sales for all regions while one region is selected.

  • Fiscal year-to-date total

    Fiscal calendars · Advanced

    Accumulate sales from the start of the fiscal year, for fiscal years that do not begin in January.

  • Rank by sales

    Ranking & Top N · Intermediate

    Give each product a rank (1 = best) that respects the slicers.

  • Top N products

    Ranking & Top N · Intermediate

    Show sales only for the top N products and blank for the rest.

  • Rolling 3-month average

    Rolling averages · Intermediate

    Average monthly sales over the current month and the two months before it.

  • Rolling 7-day average

    Rolling averages · Intermediate

    Smooth daily numbers by averaging the last seven days.

  • Cumulative % of total (Pareto)

    Running totals · Advanced

    Rank items by sales and show the running share of the total, to see which items make up 80% of sales.

  • Running total over dates

    Running totals · Intermediate

    A cumulative total that adds up everything from the first visible date to the current one.

  • Year-to-date total

    Running totals · Beginner

    Accumulate a measure from 1 January up to the date in the current context.

  • Month-over-month change %

    Time intelligence · Beginner

    Compare each month with the month before it.

  • Year-over-year change %

    Time intelligence · Beginner

    Compare this period with the same period last year and show the change as a percentage.