New to DAX mechanics, I would like to do something simple:
I have included data and pbix file.
I have a matrix and need 3 measures:
- Total Sales (This one is simple and I got it)
- LYSP Sales (Last year same period sales, attention I only have periods as info)
- YTD Sales (From beginning of the year to current period)
I would like to figure out DAX logic for points 2 and 3. And I would like to use the measures in the MAtrix and respective labels.
I think I need a measure that includes a CALCULATE and a FILTER, but Im not completely sure. Most examples in web include a calendar table, but I need to do it with Periods table. Looks simple but …
Sample_Sales_Period.pbix (56.1 KB)
Simple_Sales_Sample.xlsx (14.1 KB)
As an example, if I select period 08-2021, then the measure should return something like:
SPLY Sales = CALCULATE([Total Sales],FILTER(Sales,Sales[Period] = 202008))
of course the period 202008 would have to be derived from Current period (202108) - 100000 => 202008 (or something similar)